Skip to content

Commit

Permalink
macvlan: handle set_promiscuity failures
Browse files Browse the repository at this point in the history
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: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael S. Tsirkin authored and David S. Miller committed Aug 1, 2013
1 parent 266e834 commit 7873814
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,11 @@ static int macvlan_open(struct net_device *dev)
int err;

if (vlan->port->passthru) {
if (!(vlan->flags & MACVLAN_FLAG_NOPROMISC))
dev_set_promiscuity(lowerdev, 1);
if (!(vlan->flags & MACVLAN_FLAG_NOPROMISC)) {
err = dev_set_promiscuity(lowerdev, 1);
if (err < 0)
goto out;
}
goto hash_add;
}

Expand Down

0 comments on commit 7873814

Please sign in to comment.