net: Support filtering interfaces on no master
Subsystems (2)
PATCH v3 1/1 net: Support filtering interfaces on no master
Currently there's support for filtering neighbours/links for interfaces which have a specific master device (using the IFLA_MASTER/NDA_MASTER attributes).
This patch adds support for filtering interfaces/neighbours dump for interfaces that *don't* have a master.
---
v2 -> v3
- Change the way 'master' is checked for being non NULL
v1 -> v2
- Change from filtering just for non VRF slaves to non slaves at all
net/core/neighbour.c | 7 +++++++ net/core/rtnetlink.c | 7 +++++++ 2 files changed, 14 insertions(+)
net/core/neighbour.c +7 -0
@@ -2528,6 +2528,13 @@ static bool neigh_master_filtered(struct net_device *dev, int master_idx)return false; master = dev ?netdev_master_upper_dev_get (dev) :NULL ; + +/* 0 is already used to denote NDA_MASTER wasn't passed, therefore need another +* invalid value for ifindex to denote "no master". +*/ +if (master_idx ==-1 ) +return !!master; +if (!master || master->ifindex != master_idx)return true;
net/core/rtnetlink.c +7 -0
@@ -1959,6 +1959,13 @@ static bool link_master_filtered(struct net_device *dev, int master_idx)return false; master =netdev_master_upper_dev_get (dev); + +/* 0 is already used to denote IFLA_MASTER wasn't passed, therefore need +* another invalid value for ifindex to denote "no master". +*/ +if (master_idx ==-1 ) +return !!master; +if (!master || master->ifindex != master_idx)return true;
Signature · 1 line
2.25.1
Quoted 17 lines · Lahav Schlesinger
Currently there's support for filtering neighbours/links for interfaces which have a specific master device (using the IFLA_MASTER/NDA_MASTER attributes).
This patch adds support for filtering interfaces/neighbours dump for interfaces that *don't* have a master.
Signed-off-by Lahav Schlesinger <[email protected]>Cc David Ahern <[email protected]>Cc David S. Miller <[email protected]>Cc Jakub Kicinski <[email protected]>---
v2 -> v3
- Change the way 'master' is checked for being non NULL
v1 -> v2
- Change from filtering just for non VRF slaves to non slaves at all
Quoted 4 lines
net/core/neighbour.c | 7 +++++++ net/core/rtnetlink.c | 7 +++++++ 2 files changed, 14 insertions(+)
Thanks, for resending.
Quoted 17 lines · Lahav Schlesinger
Currently there's support for filtering neighbours/links for interfaces which have a specific master device (using the IFLA_MASTER/NDA_MASTER attributes).
This patch adds support for filtering interfaces/neighbours dump for interfaces that *don't* have a master.
Signed-off-by Lahav Schlesinger <[email protected]>Cc David Ahern <[email protected]>Cc David S. Miller <[email protected]>Cc Jakub Kicinski <[email protected]>---
v2 -> v3
- Change the way 'master' is checked for being non NULL
v1 -> v2
- Change from filtering just for non VRF slaves to non slaves at all
Quoted 4 lines
net/core/neighbour.c | 7 +++++++ net/core/rtnetlink.c | 7 +++++++ 2 files changed, 14 insertions(+)
This patch was applied to netdev/net-next.git (refs/heads/master):
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 8 lines · On Tue, 10 Aug 2021 09:06:58 +0000 you wrote:
Currently there's support for filtering neighbours/links for interfaces which have a specific master device (using the IFLA_MASTER/NDA_MASTER attributes).
This patch adds support for filtering interfaces/neighbours dump for interfaces that *don't* have a master.
[...]
Here is the summary with links:
- [net-next,v3] net: Support filtering interfaces on no master
https://git.kernel.org/netdev/net-next/c/d3432bf10f17
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html