linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Generate netlink notification when default IPv6 route preference changes
@ 2022-02-10 22:09 Kalash Nainwal
  2022-02-12 19:32 ` David Ahern
  2022-02-14 11:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Kalash Nainwal @ 2022-02-10 22:09 UTC (permalink / raw)
  To: netdev
  Cc: fruggeri, kalash, dsahern, David S. Miller, Hideaki YOSHIFUJI,
	David Ahern, Jakub Kicinski, linux-kernel

 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>
---
 net/ipv6/ndisc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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)
-- 
2.30.1 (Apple Git-130)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Generate netlink notification when default IPv6 route preference changes
  2022-02-10 22:09 [PATCH v2] Generate netlink notification when default IPv6 route preference changes Kalash Nainwal
@ 2022-02-12 19:32 ` David Ahern
  2022-02-14 11:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2022-02-12 19:32 UTC (permalink / raw)
  To: Kalash Nainwal, netdev
  Cc: fruggeri, David S. Miller, Hideaki YOSHIFUJI, David Ahern,
	Jakub Kicinski, linux-kernel

On 2/10/22 2:09 PM, Kalash Nainwal wrote:
>  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>
> ---
>  net/ipv6/ndisc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Generate netlink notification when default IPv6 route preference changes
  2022-02-10 22:09 [PATCH v2] Generate netlink notification when default IPv6 route preference changes Kalash Nainwal
  2022-02-12 19:32 ` David Ahern
@ 2022-02-14 11:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-14 11:20 UTC (permalink / raw)
  To: Kalash Nainwal
  Cc: netdev, fruggeri, dsahern, davem, yoshfuji, dsahern, kuba, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 10 Feb 2022 14:09:35 -0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v2] Generate netlink notification when default IPv6 route preference changes
    https://git.kernel.org/netdev/net-next/c/806c37ddcf28

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-14 11:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 22:09 [PATCH v2] Generate netlink notification when default IPv6 route preference changes Kalash Nainwal
2022-02-12 19:32 ` David Ahern
2022-02-14 11:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).