diff options
author | Kalash Nainwal <kalash@arista.com> | 2022-02-11 01:09:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-02-14 14:15:37 +0300 |
commit | 806c37ddcf286665adce5c3a99b5fe4424cbf9fe (patch) | |
tree | 3811afe482af9e67fc6df748a01989cc9017af5e /net/ipv6 | |
parent | 4ddc844eb81da59bfb816d8d52089aba4e59e269 (diff) | |
download | linux-806c37ddcf286665adce5c3a99b5fe4424cbf9fe.tar.xz |
Generate netlink notification when default IPv6 route preference changes
Generate RTM_NEWROUTE netlink notification when the route preference
changes on an existing kernel generated default route in response to
RA messages. Currently netlink notifications are generated only when
this route is added or deleted but not when the route preference
changes, which can cause userspace routing application state to go
out of sync with kernel.
Signed-off-by: Kalash Nainwal <kalash@arista.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ndisc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index f03b597e4121..1c06d0cd02f7 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1337,8 +1337,12 @@ static void ndisc_router_discovery(struct sk_buff *skb) return; } neigh->flags |= NTF_ROUTER; - } else if (rt) { + } else if (rt && IPV6_EXTRACT_PREF(rt->fib6_flags) != pref) { + struct nl_info nlinfo = { + .nl_net = net, + }; rt->fib6_flags = (rt->fib6_flags & ~RTF_PREF_MASK) | RTF_PREF(pref); + inet6_rt_notify(RTM_NEWROUTE, rt, &nlinfo, NLM_F_REPLACE); } if (rt) |