diff options
| author | Florian Westphal <[email protected]> | 2020-05-04 08:06:04 +0000 |
|---|---|---|
| committer | Steffen Klassert <[email protected]> | 2020-05-06 07:40:08 +0000 |
| commit | a269fbfc4e9ffe48c1f8142e60a49b6f2e588c58 (patch) | |
| tree | 0459d0299d1d7c059f5950180fcbb8fe2fbc0bcc /net/ipv6/xfrm6_output.c | |
| parent | xfrm: avoid extract_output indirection for ipv4 (diff) | |
| download | kernel-a269fbfc4e9ffe48c1f8142e60a49b6f2e588c58.tar.gz kernel-a269fbfc4e9ffe48c1f8142e60a49b6f2e588c58.zip | |
xfrm: state: remove extract_input indirection from xfrm_state_afinfo
In order to keep CONFIG_IPV6=m working, xfrm6_extract_header needs to be
duplicated. It will be removed again in a followup change when the
remaining caller is moved to net/xfrm as well.
Signed-off-by: Florian Westphal <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
Diffstat (limited to 'net/ipv6/xfrm6_output.c')
| -rw-r--r-- | net/ipv6/xfrm6_output.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c index fbe51d40bd7e..855078a43fc7 100644 --- a/net/ipv6/xfrm6_output.c +++ b/net/ipv6/xfrm6_output.c @@ -94,6 +94,20 @@ out: return ret; } +static void __xfrm6_extract_header(struct sk_buff *skb) +{ + struct ipv6hdr *iph = ipv6_hdr(skb); + + XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); + XFRM_MODE_SKB_CB(skb)->id = 0; + XFRM_MODE_SKB_CB(skb)->frag_off = htons(IP_DF); + XFRM_MODE_SKB_CB(skb)->tos = ipv6_get_dsfield(iph); + XFRM_MODE_SKB_CB(skb)->ttl = iph->hop_limit; + XFRM_MODE_SKB_CB(skb)->optlen = 0; + memcpy(XFRM_MODE_SKB_CB(skb)->flow_lbl, iph->flow_lbl, + sizeof(XFRM_MODE_SKB_CB(skb)->flow_lbl)); +} + int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb) { int err; @@ -104,7 +118,8 @@ int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb) XFRM_MODE_SKB_CB(skb)->protocol = ipv6_hdr(skb)->nexthdr; - return xfrm6_extract_header(skb); + __xfrm6_extract_header(skb); + return 0; } int xfrm6_output_finish(struct sock *sk, struct sk_buff *skb) |
