]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ipv6: Add delete route hook to stubs
authorDavid Ahern <dsahern@gmail.com>
Wed, 22 May 2019 19:04:39 +0000 (12:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 May 2019 00:48:43 +0000 (17:48 -0700)
Add ip6_del_rt to the IPv6 stub. The hook is needed by the nexthop
code to remove entries linked to a nexthop that is getting deleted.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ipv6_stubs.h
net/ipv6/addrconf_core.c
net/ipv6/af_inet6.c

index 6c0c4fde16f8902ecb9baf23cbc8db182dc2ab8c..307114a46eee5cf07cd4f159d5ac633d40d9798a 100644 (file)
@@ -45,6 +45,7 @@ struct ipv6_stub {
                            struct fib6_config *cfg, gfp_t gfp_flags,
                            struct netlink_ext_ack *extack);
        void (*fib6_nh_release)(struct fib6_nh *fib6_nh);
+       int (*ip6_del_rt)(struct net *net, struct fib6_info *rt);
        void (*udpv6_encap_enable)(void);
        void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr,
                              const struct in6_addr *solicited_addr,
index 5b1246635e02ab350927fe8981153004739de26b..783f3c1466daca7ea3d348fa1cc766fcc9026d62 100644 (file)
@@ -183,6 +183,11 @@ static int eafnosupport_fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh,
        return -EAFNOSUPPORT;
 }
 
+static int eafnosupport_ip6_del_rt(struct net *net, struct fib6_info *rt)
+{
+       return -EAFNOSUPPORT;
+}
+
 const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) {
        .ipv6_dst_lookup   = eafnosupport_ipv6_dst_lookup,
        .ipv6_route_input  = eafnosupport_ipv6_route_input,
@@ -192,6 +197,7 @@ const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) {
        .fib6_select_path  = eafnosupport_fib6_select_path,
        .ip6_mtu_from_fib6 = eafnosupport_ip6_mtu_from_fib6,
        .fib6_nh_init      = eafnosupport_fib6_nh_init,
+       .ip6_del_rt        = eafnosupport_ip6_del_rt,
 };
 EXPORT_SYMBOL_GPL(ipv6_stub);
 
index c04ae282f4e4747090314fc44f041a2f00f8efb6..bc2ca61a020a4eb591918b10f266fe9fbfdee1d7 100644 (file)
@@ -926,6 +926,7 @@ static const struct ipv6_stub ipv6_stub_impl = {
        .ip6_mtu_from_fib6 = ip6_mtu_from_fib6,
        .fib6_nh_init      = fib6_nh_init,
        .fib6_nh_release   = fib6_nh_release,
+       .ip6_del_rt        = ip6_del_rt,
        .udpv6_encap_enable = udpv6_encap_enable,
        .ndisc_send_na = ndisc_send_na,
        .nd_tbl = &nd_tbl,