diff options
author | Florian Westphal <fw@strlen.de> | 2020-05-04 10:06:05 +0200 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2020-05-06 09:40:08 +0200 |
commit | 171916cbd53dec5c7b05efb56a201671d92effc1 (patch) | |
tree | d4e2e497d945076a847c10b861653da590f75127 /net/ipv4/xfrm4_state.c | |
parent | xfrm: state: remove extract_input indirection from xfrm_state_afinfo (diff) | |
download | linux-171916cbd53dec5c7b05efb56a201671d92effc1.tar.xz linux-171916cbd53dec5c7b05efb56a201671d92effc1.zip |
xfrm: move xfrm4_extract_header to common helper
The function only initializes the XFRM CB in the skb.
After previous patch xfrm4_extract_header is only called from
net/xfrm/xfrm_{input,output}.c.
Because of IPV6=m linker errors the ipv6 equivalent
(xfrm6_extract_header) was already placed in xfrm_inout.h because
we can't call functions residing in a module from the core.
So do the same for the ipv4 helper and place it next to the ipv6 one.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv4/xfrm4_state.c')
-rw-r--r-- | net/ipv4/xfrm4_state.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c index 521fc1bc069c..b23a1711297b 100644 --- a/net/ipv4/xfrm4_state.c +++ b/net/ipv4/xfrm4_state.c @@ -8,28 +8,7 @@ * */ -#include <net/ip.h> #include <net/xfrm.h> -#include <linux/pfkeyv2.h> -#include <linux/ipsec.h> -#include <linux/netfilter_ipv4.h> -#include <linux/export.h> - -int xfrm4_extract_header(struct sk_buff *skb) -{ - const struct iphdr *iph = ip_hdr(skb); - - XFRM_MODE_SKB_CB(skb)->ihl = sizeof(*iph); - XFRM_MODE_SKB_CB(skb)->id = iph->id; - XFRM_MODE_SKB_CB(skb)->frag_off = iph->frag_off; - XFRM_MODE_SKB_CB(skb)->tos = iph->tos; - XFRM_MODE_SKB_CB(skb)->ttl = iph->ttl; - XFRM_MODE_SKB_CB(skb)->optlen = iph->ihl * 4 - sizeof(*iph); - memset(XFRM_MODE_SKB_CB(skb)->flow_lbl, 0, - sizeof(XFRM_MODE_SKB_CB(skb)->flow_lbl)); - - return 0; -} static struct xfrm_state_afinfo xfrm4_state_afinfo = { .family = AF_INET, |