John Fastabend [off-list ref] wrote on 06/04/2012 10:08:04
PM:
quoted
I think you should do something like:
if ((flags == BRIDGE_FLAGS_MASTER) && ...)
...
Also you could use BRIDGE_FLAGS_MASTER=1, SELF=2, and use
"if (flags & BRIDGE_FLAGS_MASTER)" for consistency?
OK this is likely a good thing otherwise user space is a
bit tedious when managing FDB and bridge modes. We do still
need the !flags case to support existing applications though,
(we must maintain existing semantics)
if (!flags || (flags & BRIDGE_FLAGS_MASTER) && ...)
...
else (flags & BRIDGE_FLAGS_SELF)
...
Yes, looks good.
quoted
It is possible to return a reporting error even though
the operation succeeded. Maybe something that could be
done here to indicate that the operation succeeded, or
is that a TODO?
The problem is if rtnl_bridge_notify fails due to memory
constraints or otherwise. In this case the set has already
completed successfully as you note so we should not return
any error. This should fix it if I understand your concern
correctly.
if (!err)
rtnl_bridge_notify(dev, flags);
return err;
Yes. I guess user will not hang waiting for a response as it
will pass NLM_F_ACK, which allows netlink_rcv_skb to call
netlink_ack.
Thanks,
- KK