aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_mode_tunnel.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-10 23:50:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:24:59 -0400
commitd56f90a7c96da5187f0cdf07ee7434fe6aa78bbc (patch)
tree3b9073cecfbb3b6a1e25ab2b5dd2a22a43aef238 /net/ipv6/xfrm6_mode_tunnel.c
parentbbe735e4247dba32568a305553b010081c8dea99 (diff)
[SK_BUFF]: Introduce skb_network_header()
For the places where we need a pointer to the network header, it is still legal to touch skb->nh.raw directly if just adding to, subtracting from or setting it to another layer header. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/xfrm6_mode_tunnel.c')
-rw-r--r--net/ipv6/xfrm6_mode_tunnel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv6/xfrm6_mode_tunnel.c b/net/ipv6/xfrm6_mode_tunnel.c
index 8ce5ef2d0b1c..498f17b5c42f 100644
--- a/net/ipv6/xfrm6_mode_tunnel.c
+++ b/net/ipv6/xfrm6_mode_tunnel.c
@@ -87,9 +87,10 @@ static int xfrm6_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
87{ 87{
88 int err = -EINVAL; 88 int err = -EINVAL;
89 const unsigned char *old_mac; 89 const unsigned char *old_mac;
90 const unsigned char *nh = skb_network_header(skb);
90 91
91 if (skb->nh.raw[IP6CB(skb)->nhoff] != IPPROTO_IPV6 92 if (nh[IP6CB(skb)->nhoff] != IPPROTO_IPV6 &&
92 && skb->nh.raw[IP6CB(skb)->nhoff] != IPPROTO_IPIP) 93 nh[IP6CB(skb)->nhoff] != IPPROTO_IPIP)
93 goto out; 94 goto out;
94 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) 95 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
95 goto out; 96 goto out;
@@ -98,7 +99,8 @@ static int xfrm6_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
98 (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) 99 (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
99 goto out; 100 goto out;
100 101
101 if (skb->nh.raw[IP6CB(skb)->nhoff] == IPPROTO_IPV6) { 102 nh = skb_network_header(skb);
103 if (nh[IP6CB(skb)->nhoff] == IPPROTO_IPV6) {
102 if (x->props.flags & XFRM_STATE_DECAP_DSCP) 104 if (x->props.flags & XFRM_STATE_DECAP_DSCP)
103 ipv6_copy_dscp(skb->nh.ipv6h, skb->h.ipv6h); 105 ipv6_copy_dscp(skb->nh.ipv6h, skb->h.ipv6h);
104 if (!(x->props.flags & XFRM_STATE_NOECN)) 106 if (!(x->props.flags & XFRM_STATE_NOECN))