Netdev List
 help / color / mirror / Atom feed
From: Amerigo Wang <amwang@redhat.com>
To: netdev@vger.kernel.org
Cc: WANG Cong <amwang@redhat.com>, Neil Horman <nhorman@tuxdriver.com>
Subject: [Patch] netpoll: prevent netpoll setup on slave devices
Date: Thu,  9 Jun 2011 10:42:40 +0800	[thread overview]
Message-ID: <1307587360-3092-1-git-send-email-amwang@redhat.com> (raw)

In commit 8d8fc29d02a33e4bd5f4fa47823c1fd386346093
(netpoll: disable netpoll when enslave a device), we automatically
disable netpoll when the underlying device is being enslaved,
we also need to prevent people from setuping netpoll on
devices that are already enslaved.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>

---
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 2d7d6d4..42ea4b0 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -792,6 +792,12 @@ int netpoll_setup(struct netpoll *np)
 		return -ENODEV;
 	}
 
+	if (ndev->master) {
+		printk(KERN_ERR "%s: %s is a slave device, aborting.\n",
+		       np->name, np->dev_name);
+		return -EBUSY;
+	}
+
 	if (!netif_running(ndev)) {
 		unsigned long atmost, atleast;
 

             reply	other threads:[~2011-06-09  2:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09  2:42 Amerigo Wang [this message]
2011-06-09  7:28 ` [Patch] netpoll: prevent netpoll setup on slave devices 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=1307587360-3092-1-git-send-email-amwang@redhat.com \
    --to=amwang@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox