Skip to content

Commit

Permalink
netpoll: prevent netpoll setup on slave devices
Browse files Browse the repository at this point in the history
In commit 8d8fc29
(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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
WANG Cong authored and davem330 committed Jun 9, 2011
1 parent fe6fe79 commit 0c1ad04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0c1ad04

Please sign in to comment.