xfrm: add support for UDPv6 encapsulation of ESP
This patch adds support for encapsulation of ESP over UDPv6. The code is very similar to the IPv4 encapsulation implementation, and allows to easily add espintcp on IPv6 as a follow-up. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
committed by
Steffen Klassert
parent
e62905ae34
commit
0146dca70b
@@ -56,6 +56,9 @@ struct ipv6_stub {
|
||||
void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr,
|
||||
const struct in6_addr *solicited_addr,
|
||||
bool router, bool solicited, bool override, bool inc_opt);
|
||||
#if IS_ENABLED(CONFIG_XFRM)
|
||||
int (*xfrm6_udp_encap_rcv)(struct sock *sk, struct sk_buff *skb);
|
||||
#endif
|
||||
struct neigh_table *nd_tbl;
|
||||
};
|
||||
extern const struct ipv6_stub *ipv6_stub __read_mostly;
|
||||
|
||||
@@ -1406,6 +1406,8 @@ struct xfrm4_protocol {
|
||||
|
||||
struct xfrm6_protocol {
|
||||
int (*handler)(struct sk_buff *skb);
|
||||
int (*input_handler)(struct sk_buff *skb, int nexthdr, __be32 spi,
|
||||
int encap_type);
|
||||
int (*cb_handler)(struct sk_buff *skb, int err);
|
||||
int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
||||
u8 type, u8 code, int offset, __be32 info);
|
||||
@@ -1590,6 +1592,8 @@ int xfrm6_extract_header(struct sk_buff *skb);
|
||||
int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb);
|
||||
int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi,
|
||||
struct ip6_tnl *t);
|
||||
int xfrm6_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
|
||||
int encap_type);
|
||||
int xfrm6_transport_finish(struct sk_buff *skb, int async);
|
||||
int xfrm6_rcv_tnl(struct sk_buff *skb, struct ip6_tnl *t);
|
||||
int xfrm6_rcv(struct sk_buff *skb);
|
||||
@@ -1610,6 +1614,7 @@ int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
|
||||
|
||||
#ifdef CONFIG_XFRM
|
||||
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 xfrm_user_policy(struct sock *sk, int optname,
|
||||
u8 __user *optval, int optlen);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user