aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_input.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-25 21:04:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:31 -0400
commit9c70220b73908f64792422a2c39c593c4792f2c5 (patch)
tree2090ea10aaa2714a5e095bae8cc02e743c378a3a /net/xfrm/xfrm_input.c
parenta27ef749e7be3b06fb58df53d94eb97a21f18707 (diff)
[SK_BUFF]: Introduce skb_transport_header(skb)
For the places where we need a pointer to the transport header, it is still legal to touch skb->h.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/xfrm/xfrm_input.c')
-rw-r--r--net/xfrm/xfrm_input.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index ee15bdae1419..5c4695840c58 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -62,7 +62,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq)
62 case IPPROTO_COMP: 62 case IPPROTO_COMP:
63 if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) 63 if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr)))
64 return -EINVAL; 64 return -EINVAL;
65 *spi = htonl(ntohs(*(__be16*)(skb->h.raw + 2))); 65 *spi = htonl(ntohs(*(__be16*)(skb_transport_header(skb) + 2)));
66 *seq = 0; 66 *seq = 0;
67 return 0; 67 return 0;
68 default: 68 default:
@@ -72,8 +72,8 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq)
72 if (!pskb_may_pull(skb, 16)) 72 if (!pskb_may_pull(skb, 16))
73 return -EINVAL; 73 return -EINVAL;
74 74
75 *spi = *(__be32*)(skb->h.raw + offset); 75 *spi = *(__be32*)(skb_transport_header(skb) + offset);
76 *seq = *(__be32*)(skb->h.raw + offset_seq); 76 *seq = *(__be32*)(skb_transport_header(skb) + offset_seq);
77 return 0; 77 return 0;
78} 78}
79EXPORT_SYMBOL(xfrm_parse_spi); 79EXPORT_SYMBOL(xfrm_parse_spi);