aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_netlink.c
diff options
context:
space:
mode:
authorHong zhi guo <honkiko@gmail.com>2013-03-23 23:26:47 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-24 17:16:30 -0400
commit7b99a99390ca328f4678ac04358c94744ab0f8b4 (patch)
tree266b13a857c2d2c62566e30db838954bedd3c01c /net/bridge/br_netlink.c
parent5e95329b701c4edf6c4d72487ec0369fa148c0bd (diff)
bridge: avoid br_ifinfo_notify when nothing changed
When neither IFF_BRIDGE nor IFF_BRIDGE_PORT is set, and afspec == NULL but protinfo != NULL, we run into "if (err == 0) br_ifinfo_notify(RTM_NEWLINK, p);" with random value in ret. Thanks to Sergei for pointing out the error in commit comments. Signed-off-by: Hong Zhiguo <honkiko@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r--net/bridge/br_netlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 84c3b7d6d1b1..b96e02e31bad 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -357,7 +357,7 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh)
357 struct nlattr *afspec; 357 struct nlattr *afspec;
358 struct net_bridge_port *p; 358 struct net_bridge_port *p;
359 struct nlattr *tb[IFLA_BRPORT_MAX + 1]; 359 struct nlattr *tb[IFLA_BRPORT_MAX + 1];
360 int err; 360 int err = 0;
361 361
362 ifm = nlmsg_data(nlh); 362 ifm = nlmsg_data(nlh);
363 363
@@ -370,7 +370,7 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh)
370 /* We want to accept dev as bridge itself if the AF_SPEC 370 /* We want to accept dev as bridge itself if the AF_SPEC
371 * is set to see if someone is setting vlan info on the brigde 371 * is set to see if someone is setting vlan info on the brigde
372 */ 372 */
373 if (!p && ((dev->priv_flags & IFF_EBRIDGE) && !afspec)) 373 if (!p && !afspec)
374 return -EINVAL; 374 return -EINVAL;
375 375
376 if (p && protinfo) { 376 if (p && protinfo) {