All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hong Zhiguo <honkiko@gmail.com>
To: netdev@vger.kernel.org
Cc: bridge@lists.linux-foundation.org, zhiguo.hong@emc.com,
	Hong Zhiguo <honkiko@gmail.com>,
	stephen@networkplumber.org, herbert@gondor.hengli.com.au,
	davem@davemloft.net
Subject: [Bridge] [PATCH net-next] bridge: avoid br_ifinfo_notify when nothing changed
Date: Sat, 23 Mar 2013 13:14:13 +0800	[thread overview]
Message-ID: <1364015653-7322-1-git-send-email-honkiko@gmail.com> (raw)

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(-)

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) {
-- 
1.7.10.4


WARNING: multiple messages have this Message-ID (diff)
From: Hong Zhiguo <honkiko@gmail.com>
To: netdev@vger.kernel.org
Cc: bridge@lists.linux-foundation.org, davem@davemloft.net,
	stephen@networkplumber.org, herbert@gondor.hengli.com.au,
	zhiguo.hong@emc.com, Hong Zhiguo <honkiko@gmail.com>
Subject: [PATCH net-next] bridge: avoid br_ifinfo_notify when nothing changed
Date: Sat, 23 Mar 2013 13:14:13 +0800	[thread overview]
Message-ID: <1364015653-7322-1-git-send-email-honkiko@gmail.com> (raw)

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(-)

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) {
-- 
1.7.10.4

             reply	other threads:[~2013-03-23  5:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23  5:14 Hong Zhiguo [this message]
2013-03-23  5:14 ` [PATCH net-next] bridge: avoid br_ifinfo_notify when nothing changed Hong Zhiguo
2013-03-23 15:06 ` [Bridge] " Sergei Shtylyov
2013-03-23 15:06   ` Sergei Shtylyov
2013-03-24 13:26 ` [Bridge] " Hong Zhiguo
2013-03-24 13:26   ` Hong Zhiguo
2013-03-24 14:34   ` [Bridge] " Sergei Shtylyov
2013-03-24 14:34     ` Sergei Shtylyov
2013-03-24 21:15     ` [Bridge] " David Miller
2013-03-24 21:15       ` David Miller
2013-03-25 15:32       ` [Bridge] " Sergei Shtylyov
2013-03-25 15:32         ` Sergei Shtylyov
2013-03-25 16:08         ` [Bridge] " David Miller
2013-03-25 16:08           ` David Miller
2013-03-25 16:31           ` [Bridge] " Sergei Shtylyov
2013-03-25 16:31             ` Sergei Shtylyov
2013-03-24 21:18   ` [Bridge] " David Miller
2013-03-24 21:18     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364015653-7322-1-git-send-email-honkiko@gmail.com \
    --to=honkiko@gmail.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=zhiguo.hong@emc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.