]> git.itanic.dy.fi Git - linux-stable/commitdiff
rtnetlink: bridge: Invoke MDB bulk deletion when needed
authorIdo Schimmel <idosch@nvidia.com>
Sun, 17 Dec 2023 08:32:39 +0000 (10:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Dec 2023 11:27:20 +0000 (11:27 +0000)
Invoke the new MDB bulk deletion device operation when the 'NLM_F_BULK'
flag is set in the netlink message header.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c

index a0fad4d8856cb1117e85f4ca5694091e67d47383..ec185e131766cf55d2010a25c179bdebe2f8d3c9 100644 (file)
@@ -6488,6 +6488,14 @@ static int rtnl_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
                return -EINVAL;
        }
 
+       if (del_bulk) {
+               if (!dev->netdev_ops->ndo_mdb_del_bulk) {
+                       NL_SET_ERR_MSG(extack, "Device does not support MDB bulk deletion");
+                       return -EOPNOTSUPP;
+               }
+               return dev->netdev_ops->ndo_mdb_del_bulk(dev, tb, extack);
+       }
+
        if (!dev->netdev_ops->ndo_mdb_del) {
                NL_SET_ERR_MSG(extack, "Device does not support MDB operations");
                return -EOPNOTSUPP;