br_mdb_add and br_mdb_del call respectively __br_mdb_add and
__br_mdb_del and notify the message type on success.
Factorize this in a new __br_mdb_do function which add or delete a
br_mdb_entry depending on the message type, then notify it.
Note that the dev argument is p->br->dev, so no need to
The __br_mdb_add function uses exactly the same mechanism as its caller
br_mdb_add to retrieve the net_bridge_port pointer from br_mdb_entry.
Remove it and pass directly the net_bridge_port pointer to __br_mdb_add.
Signed-off-by: Vivien Didelot
---
Retrieve the message type from the nlmsghdr structure instead of
hardcoding it in both br_mdb_add and br_mdb_del.
Signed-off-by: Vivien Didelot
---
net/bridge/br_mdb.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git
__br_mdb_add and __br_mdb_del both check that the bridge is up and
running and that multicast is enabled on it before doing any operation.
Since they can be called multiple times by br_mdb_add and br_mdb_del,
move the check in their caller functions so that it is done just once.
Signed-off-by:
Be symmetric with br_mdb_add and break if __br_mdb_del returns an error.
Signed-off-by: Vivien Didelot
---
net/bridge/br_mdb.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index