提交 0c1ad04a 编写于 作者: W WANG Cong 提交者: David S. Miller

netpoll: prevent netpoll setup on slave devices

In commit 8d8fc29d
(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: NWANG Cong <amwang@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fe6fe792
...@@ -792,6 +792,12 @@ int netpoll_setup(struct netpoll *np) ...@@ -792,6 +792,12 @@ int netpoll_setup(struct netpoll *np)
return -ENODEV; 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)) { if (!netif_running(ndev)) {
unsigned long atmost, atleast; unsigned long atmost, atleast;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册