提交 3e50ddd8 编写于 作者: F Florian Westphal 提交者: Steffen Klassert

xfrm: expose local_rxpmtu via ipv6_stubs

We cannot call this function from the core kernel unless we would force
CONFIG_IPV6=y.

Therefore expose this via ipv6_stubs so we can call it from net/xfrm
in the followup patch.

Since the call is expected to be unlikely, no extra code for the IPV6=y
case is added and we will always eat the indirection cost.
Signed-off-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 171916cb
...@@ -57,6 +57,7 @@ struct ipv6_stub { ...@@ -57,6 +57,7 @@ struct ipv6_stub {
const struct in6_addr *solicited_addr, const struct in6_addr *solicited_addr,
bool router, bool solicited, bool override, bool inc_opt); bool router, bool solicited, bool override, bool inc_opt);
#if IS_ENABLED(CONFIG_XFRM) #if IS_ENABLED(CONFIG_XFRM)
void (*xfrm6_local_rxpmtu)(struct sk_buff *skb, u32 mtu);
int (*xfrm6_udp_encap_rcv)(struct sock *sk, struct sk_buff *skb); int (*xfrm6_udp_encap_rcv)(struct sock *sk, struct sk_buff *skb);
int (*xfrm6_rcv_encap)(struct sk_buff *skb, int nexthdr, __be32 spi, int (*xfrm6_rcv_encap)(struct sk_buff *skb, int nexthdr, __be32 spi,
int encap_type); int encap_type);
......
...@@ -1608,6 +1608,7 @@ int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, ...@@ -1608,6 +1608,7 @@ int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
u8 **prevhdr); u8 **prevhdr);
#ifdef CONFIG_XFRM #ifdef CONFIG_XFRM
void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu);
int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb); int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb);
int xfrm6_udp_encap_rcv(struct sock *sk, struct sk_buff *skb); int xfrm6_udp_encap_rcv(struct sock *sk, struct sk_buff *skb);
int xfrm_user_policy(struct sock *sk, int optname, int xfrm_user_policy(struct sock *sk, int optname,
......
...@@ -963,6 +963,7 @@ static const struct ipv6_stub ipv6_stub_impl = { ...@@ -963,6 +963,7 @@ static const struct ipv6_stub ipv6_stub_impl = {
.udpv6_encap_enable = udpv6_encap_enable, .udpv6_encap_enable = udpv6_encap_enable,
.ndisc_send_na = ndisc_send_na, .ndisc_send_na = ndisc_send_na,
#if IS_ENABLED(CONFIG_XFRM) #if IS_ENABLED(CONFIG_XFRM)
.xfrm6_local_rxpmtu = xfrm6_local_rxpmtu,
.xfrm6_udp_encap_rcv = xfrm6_udp_encap_rcv, .xfrm6_udp_encap_rcv = xfrm6_udp_encap_rcv,
.xfrm6_rcv_encap = xfrm6_rcv_encap, .xfrm6_rcv_encap = xfrm6_rcv_encap,
#endif #endif
......
...@@ -40,7 +40,7 @@ static int xfrm6_local_dontfrag(struct sk_buff *skb) ...@@ -40,7 +40,7 @@ static int xfrm6_local_dontfrag(struct sk_buff *skb)
return 0; return 0;
} }
static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu) void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu)
{ {
struct flowi6 fl6; struct flowi6 fl6;
struct sock *sk = skb->sk; struct sock *sk = skb->sk;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册