aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/xfrm4_mode_beet.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-21 01:47:35 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:10 -0400
commiteddc9ec53be2ecdbf4efe0efd4a83052594f0ac0 (patch)
tree4a38ab4dbd9d61fdf5a5ea6ed61463e0b9e33ba7 /net/ipv4/xfrm4_mode_beet.c
parente023dd643798c4f06c16466af90b4d250e4b8bd7 (diff)
[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/xfrm4_mode_beet.c')
-rw-r--r--net/ipv4/xfrm4_mode_beet.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c
index 505fca034a1f..9e5ba12c6c75 100644
--- a/net/ipv4/xfrm4_mode_beet.c
+++ b/net/ipv4/xfrm4_mode_beet.c
@@ -32,8 +32,8 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
32 struct iphdr *iph, *top_iph = NULL; 32 struct iphdr *iph, *top_iph = NULL;
33 int hdrlen, optlen; 33 int hdrlen, optlen;
34 34
35 iph = skb->nh.iph; 35 iph = ip_hdr(skb);
36 skb->h.ipiph = iph; 36 skb->h.raw = skb->nh.raw;
37 37
38 hdrlen = 0; 38 hdrlen = 0;
39 optlen = iph->ihl * 4 - sizeof(*iph); 39 optlen = iph->ihl * 4 - sizeof(*iph);
@@ -42,7 +42,7 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
42 42
43 skb_push(skb, x->props.header_len + hdrlen); 43 skb_push(skb, x->props.header_len + hdrlen);
44 skb_reset_network_header(skb); 44 skb_reset_network_header(skb);
45 top_iph = skb->nh.iph; 45 top_iph = ip_hdr(skb);
46 skb->h.raw += sizeof(*iph) - hdrlen; 46 skb->h.raw += sizeof(*iph) - hdrlen;
47 47
48 memmove(top_iph, iph, sizeof(*iph)); 48 memmove(top_iph, iph, sizeof(*iph));
@@ -70,7 +70,7 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb)
70 70
71static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb) 71static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
72{ 72{
73 struct iphdr *iph = skb->nh.iph; 73 struct iphdr *iph = ip_hdr(skb);
74 int phlen = 0; 74 int phlen = 0;
75 int optlen = 0; 75 int optlen = 0;
76 __u8 ph_nexthdr = 0, protocol = 0; 76 __u8 ph_nexthdr = 0, protocol = 0;
@@ -102,7 +102,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
102 skb->h.raw = skb->data + (phlen + optlen); 102 skb->h.raw = skb->data + (phlen + optlen);
103 skb->data = skb->h.raw; 103 skb->data = skb->h.raw;
104 104
105 iph = skb->nh.iph; 105 iph = ip_hdr(skb);
106 iph->ihl = (sizeof(*iph) + optlen) / 4; 106 iph->ihl = (sizeof(*iph) + optlen) / 4;
107 iph->tot_len = htons(skb->len + iph->ihl * 4); 107 iph->tot_len = htons(skb->len + iph->ihl * 4);
108 iph->daddr = x->sel.daddr.a4; 108 iph->daddr = x->sel.daddr.a4;