浏览代码

bridge: mcast: do nothing if port's multicast_router is set to the same val

This is needed for the upcoming temporary port router. There's no point
to go through the logic if the value is the same.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Nikolay Aleksandrov 9 年之前
父节点
当前提交
4950cfd1e6
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      net/bridge/br_multicast.c

+ 4 - 1
net/bridge/br_multicast.c

@@ -1853,7 +1853,10 @@ int br_multicast_set_port_router(struct net_bridge_port *p, unsigned long val)
 	int err = -EINVAL;
 	int err = -EINVAL;
 
 
 	spin_lock(&br->multicast_lock);
 	spin_lock(&br->multicast_lock);
-
+	if (p->multicast_router == val) {
+		err = 0;
+		goto unlock;
+	}
 	switch (val) {
 	switch (val) {
 	case MDB_RTR_TYPE_DISABLED:
 	case MDB_RTR_TYPE_DISABLED:
 		p->multicast_router = MDB_RTR_TYPE_DISABLED;
 		p->multicast_router = MDB_RTR_TYPE_DISABLED;