aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/xfrm4_mode_beet.c
diff options
context:
space:
mode:
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;