]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ipv6: Add hook to bump sernum for a route to stubs
authorDavid Ahern <dsahern@gmail.com>
Wed, 22 May 2019 19:04:40 +0000 (12:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 May 2019 00:48:43 +0000 (17:48 -0700)
Add hook to ipv6 stub to bump the sernum up to the root node for a
route. This is needed by the nexthop code when a nexthop config changes.

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

index 525f701653ca69596b941f5f3b4a438d634c4e6c..d038d02cbc3c5cb323fa216f72900a121339b045 100644 (file)
@@ -485,6 +485,7 @@ int fib6_tables_dump(struct net *net, struct notifier_block *nb);
 
 void fib6_update_sernum(struct net *net, struct fib6_info *rt);
 void fib6_update_sernum_upto_root(struct net *net, struct fib6_info *rt);
+void fib6_update_sernum_stub(struct net *net, struct fib6_info *f6i);
 
 void fib6_metric_set(struct fib6_info *f6i, int metric, u32 val);
 static inline bool fib6_metric_locked(struct fib6_info *f6i, int metric)
index 307114a46eee5cf07cd4f159d5ac633d40d9798a..97f42e16b3b36bd9c367b9bfa1c3992288cce457 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);
+       void (*fib6_update_sernum)(struct net *net, struct fib6_info *rt);
        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,
index bc2ca61a020a4eb591918b10f266fe9fbfdee1d7..55138f0d2b9d0c144a5a3abaa73e994aa7eb0975 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,
+       .fib6_update_sernum = fib6_update_sernum_stub,
        .ip6_del_rt        = ip6_del_rt,
        .udpv6_encap_enable = udpv6_encap_enable,
        .ndisc_send_na = ndisc_send_na,
index 008421b550c6bfd449665aa5e7ba5505fcabe53d..df726fb8f70f8dadc7a9bf1fed559b5603e468aa 100644 (file)
@@ -1222,6 +1222,14 @@ void fib6_update_sernum_upto_root(struct net *net, struct fib6_info *rt)
        __fib6_update_sernum_upto_root(rt, fib6_new_sernum(net));
 }
 
+/* allow ipv4 to update sernum via ipv6_stub */
+void fib6_update_sernum_stub(struct net *net, struct fib6_info *f6i)
+{
+       spin_lock_bh(&f6i->fib6_table->tb6_lock);
+       fib6_update_sernum_upto_root(net, f6i);
+       spin_unlock_bh(&f6i->fib6_table->tb6_lock);
+}
+
 /*
  *     Add routing information to the routing tree.
  *     <destination addr>/<source addr>