summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-10 19:57:15 -0300
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:24:54 -0700
commit1ced98e81d1c2f1ce965ecf8d0032e02ffa07bf0 (patch)
tree135955ffd557808f97aeb126efde39f8eeaeefbf /net/ipv6
parent8856dfa3e9b71ac2177016f66ace3a8978afecc1 (diff)
downloadop-kernel-dev-1ced98e81d1c2f1ce965ecf8d0032e02ffa07bf0.zip
op-kernel-dev-1ced98e81d1c2f1ce965ecf8d0032e02ffa07bf0.tar.gz
[SK_BUFF] ipv6: More skb_reset_network_header conversions related to skb_pull
Now related to this form: skb->nh.ipv6h = (struct ipv6hdr *)skb_put(skb, length); That, as the others, is done when skb->tail is still equal to skb->data, making the conversion to skb_reset_network_header possible. Also one more case equivalent to skb->nh.raw = skb->data, of this form: iph = (struct ipv6hdr *)skb->data; <SNIP> skb->nh.ipv6h = iph; Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/datagram.c5
-rw-r--r--net/ipv6/netfilter/ip6t_REJECT.c5
-rw-r--r--net/ipv6/raw.c4
3 files changed, 9 insertions, 5 deletions
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 3b4e8dc..31a20f1 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -251,8 +251,9 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info)
if (!skb)
return;
- iph = (struct ipv6hdr*)skb_put(skb, sizeof(struct ipv6hdr));
- skb->nh.ipv6h = iph;
+ skb_put(skb, sizeof(struct ipv6hdr));
+ skb_reset_network_header(skb);
+ iph = skb->nh.ipv6h;
ipv6_addr_copy(&iph->daddr, &fl->fl6_dst);
serr = SKB_EXT_ERR(skb);
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index 6abee94..4441bed 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -120,8 +120,9 @@ static void send_reset(struct sk_buff *oldskb)
skb_reserve(nskb, hh_len + dst->header_len);
- ip6h = nskb->nh.ipv6h = (struct ipv6hdr *)
- skb_put(nskb, sizeof(struct ipv6hdr));
+ skb_put(nskb, sizeof(struct ipv6hdr));
+ skb_reset_network_header(nskb);
+ ip6h = nskb->nh.ipv6h;
ip6h->version = 6;
ip6h->hop_limit = dst_metric(dst, RTAX_HOPLIMIT);
ip6h->nexthdr = IPPROTO_TCP;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 203e069..5f26645 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -575,7 +575,9 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
skb->priority = sk->sk_priority;
skb->dst = dst_clone(&rt->u.dst);
- skb->nh.ipv6h = iph = (struct ipv6hdr *)skb_put(skb, length);
+ skb_put(skb, length);
+ skb_reset_network_header(skb);
+ iph = skb->nh.ipv6h;
skb->ip_summed = CHECKSUM_NONE;
OpenPOWER on IntegriCloud