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 <slave> down.
- So check and delete if it has been removed.
- */
+ if (!newlink) {
delete_if(ifc);
return 0;
}
}
}
}
- 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);