diff options
author | Florian Westphal <fw@strlen.de> | 2020-05-04 11:06:07 +0300 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2020-05-06 10:40:08 +0300 |
commit | ede64dd2bfe2710549f1922a214959d966baaac3 (patch) | |
tree | 3d9f68f5fb12c1eccdb48b551076a3dda1cecd5c /include/net/xfrm.h | |
parent | 3e50ddd8b8d5067796fc87cbbb25c71451ccb385 (diff) | |
download | linux-ede64dd2bfe2710549f1922a214959d966baaac3.tar.xz |
xfrm: place xfrm6_local_dontfrag in xfrm.h
so next patch can re-use it from net/xfrm/xfrm_output.c without
causing a linker error when IPV6 is a module.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 10295ab4cdfb..8f7fb033d557 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -1993,4 +1993,20 @@ static inline int xfrm_tunnel_check(struct sk_buff *skb, struct xfrm_state *x, return 0; } + +#if IS_ENABLED(CONFIG_IPV6) +static inline bool xfrm6_local_dontfrag(const struct sock *sk) +{ + int proto; + + if (!sk || sk->sk_family != AF_INET6) + return false; + + proto = sk->sk_protocol; + if (proto == IPPROTO_UDP || proto == IPPROTO_RAW) + return inet6_sk(sk)->dontfrag; + + return false; +} +#endif #endif /* _NET_XFRM_H */ |