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 <[EMAIL PROTECTED]>
---
net/ieee80211/ieee80211_rx.c |    2 +-
net/ipv4/ipmr.c              |    4 ++--
net/sctp/input.c             |    2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
From 983fc856a958d2151f2b29ffaa55327aaeb4ea3e Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
Date: Sat, 10 Mar 2007 19:04:55 -0300
Subject: [PATCH 08/18] [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: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
---
 net/ieee80211/ieee80211_rx.c |    2 +-
 net/ipv4/ipmr.c              |    4 ++--
 net/sctp/input.c             |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index be5ffaf..7f5a352 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -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
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 05c82ca..45435f0 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -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;
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 71db668..2b0863a 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -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. */
-- 
1.5.0.2

Reply via email to