Commit 895badff authored by David S. Miller's avatar David S. Miller

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next

Steffen Klassert says:

====================
pull request (net-next): ipsec-next 2019-11-13

1) Remove a unnecessary net_exit function from the xfrm interface.
   From Xin Long.

2) Assign xfrm4_udp_encap_rcv to a UDP socket only if xfrm
   is configured. From Alexey Dobriyan.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 90bc72b1 fd1ac07f
...@@ -1613,13 +1613,6 @@ static inline int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optv ...@@ -1613,13 +1613,6 @@ static inline int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optv
{ {
return -ENOPROTOOPT; return -ENOPROTOOPT;
} }
static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
{
/* should not happen */
kfree_skb(skb);
return 0;
}
#endif #endif
struct dst_entry *__xfrm_dst_lookup(struct net *net, int tos, int oif, struct dst_entry *__xfrm_dst_lookup(struct net *net, int tos, int oif,
......
...@@ -2534,9 +2534,11 @@ int udp_lib_setsockopt(struct sock *sk, int level, int optname, ...@@ -2534,9 +2534,11 @@ int udp_lib_setsockopt(struct sock *sk, int level, int optname,
case UDP_ENCAP: case UDP_ENCAP:
switch (val) { switch (val) {
case 0: case 0:
#ifdef CONFIG_XFRM
case UDP_ENCAP_ESPINUDP: case UDP_ENCAP_ESPINUDP:
case UDP_ENCAP_ESPINUDP_NON_IKE: case UDP_ENCAP_ESPINUDP_NON_IKE:
up->encap_rcv = xfrm4_udp_encap_rcv; up->encap_rcv = xfrm4_udp_encap_rcv;
#endif
/* FALLTHROUGH */ /* FALLTHROUGH */
case UDP_ENCAP_L2TPINUDP: case UDP_ENCAP_L2TPINUDP:
up->encap_type = val; up->encap_type = val;
......
...@@ -732,30 +732,7 @@ static struct rtnl_link_ops xfrmi_link_ops __read_mostly = { ...@@ -732,30 +732,7 @@ static struct rtnl_link_ops xfrmi_link_ops __read_mostly = {
.get_link_net = xfrmi_get_link_net, .get_link_net = xfrmi_get_link_net,
}; };
static void __net_exit xfrmi_destroy_interfaces(struct xfrmi_net *xfrmn)
{
struct xfrm_if *xi;
LIST_HEAD(list);
xi = rtnl_dereference(xfrmn->xfrmi[0]);
if (!xi)
return;
unregister_netdevice_queue(xi->dev, &list);
unregister_netdevice_many(&list);
}
static void __net_exit xfrmi_exit_net(struct net *net)
{
struct xfrmi_net *xfrmn = net_generic(net, xfrmi_net_id);
rtnl_lock();
xfrmi_destroy_interfaces(xfrmn);
rtnl_unlock();
}
static struct pernet_operations xfrmi_net_ops = { static struct pernet_operations xfrmi_net_ops = {
.exit = xfrmi_exit_net,
.id = &xfrmi_net_id, .id = &xfrmi_net_id,
.size = sizeof(struct xfrmi_net), .size = sizeof(struct xfrmi_net),
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment