Hello.
On 12-06-2013 15:34, Michael S. Tsirkin wrote:
commit df8ef8f3aaa6692970a436204c4429210addb23a in linux 3.5 added a way
Please also specify that commit's summary line in parens.
to control NOPROMISC macvlan flag through netlink.
However, with a non passthrough device we don't set promisc on open or
clear it on stop, even if NOPROMISC is off. As a result:
If userspace clears NOPROMISC on open, then does not clear it on a
netlink command, promisc counter is not decremented on stop and there
will be no way to clear it once macvlan is detached.
If userspace does not clear NOPROMISC on open, then sets NOPROMISC on a
netlink command, promisc counter will be decremented from 0 and overflow
to fffffffff with no way to clear promisc afterwards.
To fix, simply ignore NOPROMISC flag in a netlink command for
non-passthrough devices, same as we do at open/stop.
While at it - since we touch this code anyway - check
dev_set_promiscuity return code and pass it to users (though an error
here is unlikely).
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
CC: Roopa Prabhu <roprabhu@xxxxxxxxx>
Cc: John Fastabend <john.r.fastabend@xxxxxxxxx>
Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
---
Please review, and consider for 3.10 and -stable.