Commit 31c7711b authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[SK_BUFF]: Some more simple skb_reset_network_header conversions

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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4209fb60
...@@ -793,7 +793,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -793,7 +793,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
skb2->protocol = __constant_htons(ETH_P_802_3); skb2->protocol = __constant_htons(ETH_P_802_3);
skb_reset_mac_header(skb2); skb_reset_mac_header(skb2);
skb_reset_network_header(skb2); skb_reset_network_header(skb2);
/* skb2->nh.raw = skb2->data + ETH_HLEN; */ /* skb2->nh.raw += ETH_HLEN; */
dev_queue_xmit(skb2); dev_queue_xmit(skb2);
} }
#endif #endif
......
...@@ -1454,7 +1454,7 @@ int pim_rcv_v1(struct sk_buff * skb) ...@@ -1454,7 +1454,7 @@ int pim_rcv_v1(struct sk_buff * skb)
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb_pull(skb, (u8*)encap - skb->data); skb_pull(skb, (u8*)encap - skb->data);
skb->nh.iph = (struct iphdr *)skb->data; skb_reset_network_header(skb);
skb->dev = reg_dev; skb->dev = reg_dev;
skb->protocol = htons(ETH_P_IP); skb->protocol = htons(ETH_P_IP);
skb->ip_summed = 0; skb->ip_summed = 0;
...@@ -1509,7 +1509,7 @@ static int pim_rcv(struct sk_buff * skb) ...@@ -1509,7 +1509,7 @@ static int pim_rcv(struct sk_buff * skb)
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb_pull(skb, (u8*)encap - skb->data); skb_pull(skb, (u8*)encap - skb->data);
skb->nh.iph = (struct iphdr *)skb->data; skb_reset_network_header(skb);
skb->dev = reg_dev; skb->dev = reg_dev;
skb->protocol = htons(ETH_P_IP); skb->protocol = htons(ETH_P_IP);
skb->ip_summed = 0; skb->ip_summed = 0;
......
...@@ -528,7 +528,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) ...@@ -528,7 +528,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
/* Fix up skb to look at the embedded net header. */ /* Fix up skb to look at the embedded net header. */
saveip = skb->nh.raw; saveip = skb->nh.raw;
savesctp = skb->h.raw; savesctp = skb->h.raw;
skb->nh.iph = iph; skb_reset_network_header(skb);
skb->h.raw = (char *)sh; skb->h.raw = (char *)sh;
sk = sctp_err_lookup(AF_INET, skb, sh, &asoc, &transport); sk = sctp_err_lookup(AF_INET, skb, sh, &asoc, &transport);
/* Put back, the original pointers. */ /* Put back, the original pointers. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment