From 09dffbd42fa35e38142d07764825b7a4498ec5b8 Mon Sep 17 00:00:00 2001 From: Srinivas Aji Date: Mon, 28 May 2007 23:44:43 +0530 Subject: [PATCH] Change notification processing to account for kernel changes We now always get NEWLINK and DELLINK notifications for bridge port additions and deletions. And DELLINK is only for port deletions. So we can always remove a bridge port on a DELLINK notification, and not make uncertain checks in fear of missing this. Signed-off-by: Srinivas Aji --- bridge_track.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/bridge_track.c b/bridge_track.c index da53d9b..00e60e3 100644 --- a/bridge_track.c +++ b/bridge_track.c @@ -513,18 +513,21 @@ int bridge_notify(int br_index, int if_index, int newlink, int up) ifc = NULL; } } - if (!ifc) + if (!ifc) { + if (!newlink) { + INFO("Got DELLINK for unknown port %d on " + "bridge %d", if_index, br_index); + return -1; + } ifc = create_if(if_index, br); + } if (!ifc) { ERROR ("Couldn't create data for interface %d (master %d)", if_index, br_index); return -1; } - if (!newlink && !is_bridge_slave(br->name, ifc->name)) { - /* brctl delif generates a DELLINK, but so does ifconfig down. - So check and delete if it has been removed. - */ + if (!newlink) { delete_if(ifc); return 0; } @@ -551,12 +554,6 @@ int bridge_notify(int br_index, int if_index, int newlink, int up) } } } - if (ifc && !ifc->is_bridge && - !is_bridge_slave(ifc->master->name, ifc->name)) { - /* Interface might have left bridge and we might have missed deletion */ - delete_if(ifc); - return 0; - } if (ifc && ifc->up != up) { if (ifc->is_bridge) set_br_up(ifc, up); -- 2.47.3