[IPV4]: Get rid of redundant IPCB->opts initialisation
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Jul 2006 21:29:53 +0000 (14:29 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Jul 2006 21:29:53 +0000 (14:29 -0700)
Now that we always zero the IPCB->opts in ip_rcv, it is no longer
necessary to do so before calling netif_rx for tunneled packets.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c
net/ipv4/ip_options.c
net/ipv4/ipip.c
net/ipv4/ipmr.c
net/ipv4/xfrm4_mode_tunnel.c
net/ipv6/sit.c

index 6ff9b10..0f9b3a3 100644 (file)
@@ -617,7 +617,6 @@ static int ipgre_rcv(struct sk_buff *skb)
                skb->mac.raw = skb->nh.raw;
                skb->nh.raw = __pskb_pull(skb, offset);
                skb_postpull_rcsum(skb, skb->h.raw, offset);
-               memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
                skb->pkt_type = PACKET_HOST;
 #ifdef CONFIG_NET_IPGRE_BROADCAST
                if (MULTICAST(iph->daddr)) {
index cbcae65..406056e 100644 (file)
@@ -256,7 +256,6 @@ int ip_options_compile(struct ip_options * opt, struct sk_buff * skb)
 
        if (!opt) {
                opt = &(IPCB(skb)->opt);
-               memset(opt, 0, sizeof(struct ip_options));
                iph = skb->nh.raw;
                opt->optlen = ((struct iphdr *)iph)->ihl*4 - sizeof(struct iphdr);
                optptr = iph + sizeof(struct iphdr);
index 3291d51..76ab50b 100644 (file)
@@ -487,7 +487,6 @@ static int ipip_rcv(struct sk_buff *skb)
 
                skb->mac.raw = skb->nh.raw;
                skb->nh.raw = skb->data;
-               memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
                skb->protocol = htons(ETH_P_IP);
                skb->pkt_type = PACKET_HOST;
 
index ba33f86..9ccacf5 100644 (file)
@@ -1461,7 +1461,6 @@ int pim_rcv_v1(struct sk_buff * skb)
        skb_pull(skb, (u8*)encap - skb->data);
        skb->nh.iph = (struct iphdr *)skb->data;
        skb->dev = reg_dev;
-       memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
        skb->protocol = htons(ETH_P_IP);
        skb->ip_summed = 0;
        skb->pkt_type = PACKET_HOST;
@@ -1517,7 +1516,6 @@ static int pim_rcv(struct sk_buff * skb)
        skb_pull(skb, (u8*)encap - skb->data);
        skb->nh.iph = (struct iphdr *)skb->data;
        skb->dev = reg_dev;
-       memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
        skb->protocol = htons(ETH_P_IP);
        skb->ip_summed = 0;
        skb->pkt_type = PACKET_HOST;
index f8d880b..13cafbe 100644 (file)
@@ -92,7 +92,6 @@ static int xfrm4_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
        skb->mac.raw = memmove(skb->data - skb->mac_len,
                               skb->mac.raw, skb->mac_len);
        skb->nh.raw = skb->data;
-       memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
        err = 0;
 
 out:
index c56aeec..836eecd 100644 (file)
@@ -380,7 +380,6 @@ static int ipip6_rcv(struct sk_buff *skb)
                secpath_reset(skb);
                skb->mac.raw = skb->nh.raw;
                skb->nh.raw = skb->data;
-               memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
                IPCB(skb)->flags = 0;
                skb->protocol = htons(ETH_P_IPV6);
                skb->pkt_type = PACKET_HOST;