Thread (24 messages) 24 messages, 2 authors, 2022-10-18

Re: [PATCH v7 net-next 1/9] net: bridge: add locked entry fdb flag to extend locked port feature

From: Ido Schimmel <idosch@nvidia.com>
Date: 2022-10-13 12:41:30
Also in: bridge, linux-kselftest, linux-mediatek, lkml, netdev

On Sun, Oct 09, 2022 at 07:40:44PM +0200, Hans J. Schultz wrote:
quoted hunk ↗ jump to hunk
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 74864dc46a7e..8008ceb45605 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -4035,6 +4035,7 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,
 		     const unsigned char *addr, u16 vid,
 		     u16 flags)
 {
+	__u32 ext_flags = 0;
 	int err = -EINVAL;
 
 	/* If aging addresses are supported device will need to
@@ -4050,6 +4051,14 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,
 		return err;
 	}
 
+	if (tb[NDA_FLAGS_EXT])
+		ext_flags = nla_get_u32(tb[NDA_FLAGS_EXT]);
+
+	if (ext_flags & NTF_EXT_LOCKED) {
+		netdev_info(dev, "invalid flags given to default FDB implementation\n");
+		return err;
+	}
I'm not sure it makes sense to deny specific flags in this case. It
might be better to just error out if NDA_FLAGS_EXT was specified.
+
 	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
 		err = dev_uc_add_excl(dev, addr);
 	else if (is_multicast_ether_addr(addr))
-- 
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help