提交 78738141 编写于 作者: M Michael S. Tsirkin 提交者: David S. Miller

macvlan: handle set_promiscuity failures

It's quite unlikely that dev_set_promiscuity will fail,
but worth checking just in case.

Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 266e8347
...@@ -337,8 +337,11 @@ static int macvlan_open(struct net_device *dev) ...@@ -337,8 +337,11 @@ static int macvlan_open(struct net_device *dev)
int err; int err;
if (vlan->port->passthru) { if (vlan->port->passthru) {
if (!(vlan->flags & MACVLAN_FLAG_NOPROMISC)) if (!(vlan->flags & MACVLAN_FLAG_NOPROMISC)) {
dev_set_promiscuity(lowerdev, 1); err = dev_set_promiscuity(lowerdev, 1);
if (err < 0)
goto out;
}
goto hash_add; goto hash_add;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册