diff options
author | WANG Cong <amwang@redhat.com> | 2011-06-09 03:28:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-09 03:28:13 -0400 |
commit | 0c1ad04aecb975f2a2014e1bc5a2fa23923ecbd9 (patch) | |
tree | fe1576d55357e8f1530cc9a3df123fbf631274dc /net/core | |
parent | fe6fe792faec3fc2d2db39b69651682b8c4e7fcb (diff) |
netpoll: prevent netpoll setup on slave devices
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/netpoll.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 2d7d6d473781..42ea4b0e59f1 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -792,6 +792,12 @@ int netpoll_setup(struct netpoll *np) | |||
792 | return -ENODEV; | 792 | return -ENODEV; |
793 | } | 793 | } |
794 | 794 | ||
795 | if (ndev->master) { | ||
796 | printk(KERN_ERR "%s: %s is a slave device, aborting.\n", | ||
797 | np->name, np->dev_name); | ||
798 | return -EBUSY; | ||
799 | } | ||
800 | |||
795 | if (!netif_running(ndev)) { | 801 | if (!netif_running(ndev)) { |
796 | unsigned long atmost, atleast; | 802 | unsigned long atmost, atleast; |
797 | 803 | ||