Message ID | 1364015653-7322-1-git-send-email-honkiko@gmail.com |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
Hello. On 23-03-2013 9:14, Hong Zhiguo wrote: > When neither IFF_BRIDGE_PORT or IFF_BRIDGE_PORT is set, That is the same flag repeated twice. > and afspec == NULL but protinfo != NULL, we run into > "if (err == 0) br_ifinfo_notify(RTM_NEWLINK, p);" with > random value in ret. > Signed-off-by: Hong Zhiguo <honkiko@gmail.com> WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 84c3b7d..b96e02e 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) struct nlattr *afspec; struct net_bridge_port *p; struct nlattr *tb[IFLA_BRPORT_MAX + 1]; - int err; + int err = 0; ifm = nlmsg_data(nlh); @@ -370,7 +370,7 @@ int br_setlink(struct net_device *dev, struct nlmsghdr *nlh) /* We want to accept dev as bridge itself if the AF_SPEC * is set to see if someone is setting vlan info on the brigde */ - if (!p && ((dev->priv_flags & IFF_EBRIDGE) && !afspec)) + if (!p && !afspec) return -EINVAL; if (p && protinfo) {
When neither IFF_BRIDGE_PORT or 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. Signed-off-by: Hong Zhiguo <honkiko@gmail.com> --- net/bridge/br_netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)