diff options
Diffstat (limited to 'net/ipv4/ah4.c')
-rw-r--r-- | net/ipv4/ah4.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index 60925fedbf16..4e8e3b079f5b 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c | |||
@@ -125,6 +125,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb) | |||
125 | { | 125 | { |
126 | int ah_hlen; | 126 | int ah_hlen; |
127 | int ihl; | 127 | int ihl; |
128 | int nexthdr; | ||
128 | int err = -EINVAL; | 129 | int err = -EINVAL; |
129 | struct iphdr *iph; | 130 | struct iphdr *iph; |
130 | struct ip_auth_hdr *ah; | 131 | struct ip_auth_hdr *ah; |
@@ -136,6 +137,7 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb) | |||
136 | 137 | ||
137 | ah = (struct ip_auth_hdr *)skb->data; | 138 | ah = (struct ip_auth_hdr *)skb->data; |
138 | ahp = x->data; | 139 | ahp = x->data; |
140 | nexthdr = ah->nexthdr; | ||
139 | ah_hlen = (ah->hdrlen + 2) << 2; | 141 | ah_hlen = (ah->hdrlen + 2) << 2; |
140 | 142 | ||
141 | if (ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_full_len) && | 143 | if (ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_full_len) && |
@@ -182,13 +184,12 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb) | |||
182 | goto out; | 184 | goto out; |
183 | } | 185 | } |
184 | } | 186 | } |
185 | ((struct iphdr*)work_buf)->protocol = ah->nexthdr; | ||
186 | skb->network_header += ah_hlen; | 187 | skb->network_header += ah_hlen; |
187 | memcpy(skb_network_header(skb), work_buf, ihl); | 188 | memcpy(skb_network_header(skb), work_buf, ihl); |
188 | skb->transport_header = skb->network_header; | 189 | skb->transport_header = skb->network_header; |
189 | __skb_pull(skb, ah_hlen + ihl); | 190 | __skb_pull(skb, ah_hlen + ihl); |
190 | 191 | ||
191 | return 0; | 192 | return nexthdr; |
192 | 193 | ||
193 | out: | 194 | out: |
194 | return err; | 195 | return err; |