[SK_BUFF]: Some more simple skb_reset_network_header conversions
authorArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 10 Mar 2007 22:04:55 +0000 (19:04 -0300)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:24:50 +0000 (22:24 -0700)
This time of the type:

 skb->nh.iph = (struct iphdr *)skb->data;

That is completely equivalent to:

 skb->nh.raw = skb->data;

Wonder why people love casts... :-)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee80211/ieee80211_rx.c
net/ipv4/ipmr.c
net/sctp/input.c

index be5ffaf6e8a5867fc46cffa57c08be4281562841..7f5a352800a01bbb2a74940c91e073cdf7bc02ca 100644 (file)
@@ -793,7 +793,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                skb2->protocol = __constant_htons(ETH_P_802_3);
                skb_reset_mac_header(skb2);
                skb_reset_network_header(skb2);
-               /* skb2->nh.raw = skb2->data + ETH_HLEN; */
+               /* skb2->nh.raw += ETH_HLEN; */
                dev_queue_xmit(skb2);
        }
 #endif
index 05c82ca45aaffd860dbba2d9900d514a07d09545..45435f0a5d6c3404abac587fa5553e7b1c5618a4 100644 (file)
@@ -1454,7 +1454,7 @@ int pim_rcv_v1(struct sk_buff * skb)
 
        skb->mac.raw = skb->nh.raw;
        skb_pull(skb, (u8*)encap - skb->data);
-       skb->nh.iph = (struct iphdr *)skb->data;
+       skb_reset_network_header(skb);
        skb->dev = reg_dev;
        skb->protocol = htons(ETH_P_IP);
        skb->ip_summed = 0;
@@ -1509,7 +1509,7 @@ static int pim_rcv(struct sk_buff * skb)
 
        skb->mac.raw = skb->nh.raw;
        skb_pull(skb, (u8*)encap - skb->data);
-       skb->nh.iph = (struct iphdr *)skb->data;
+       skb_reset_network_header(skb);
        skb->dev = reg_dev;
        skb->protocol = htons(ETH_P_IP);
        skb->ip_summed = 0;
index 71db66873695ffadeed4ac18cc68454dfbc7ab44..2b0863aba3fb3f3b5c4050196bccbf79908c232b 100644 (file)
@@ -528,7 +528,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
        /* Fix up skb to look at the embedded net header. */
        saveip = skb->nh.raw;
        savesctp  = skb->h.raw;
-       skb->nh.iph = iph;
+       skb_reset_network_header(skb);
        skb->h.raw = (char *)sh;
        sk = sctp_err_lookup(AF_INET, skb, sh, &asoc, &transport);
        /* Put back, the original pointers. */