]> git.ipfire.org Git - people/ms/rstp.git/commitdiff
Change notification processing to account for kernel changes
authorSrinivas Aji <Aji_Srinivas@emc.com>
Mon, 28 May 2007 18:14:43 +0000 (23:44 +0530)
committerSrinivas Aji <Aji_Srinivas@emc.com>
Wed, 27 Feb 2008 18:03:50 +0000 (23:33 +0530)
   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 <Aji_Srinivas@emc.com>
bridge_track.c

index da53d9bd8b75127ef466419f91335a01e2a13dff..00e60e3f5b55db8d2459c633fd5018d92b1a76e4 100644 (file)
@@ -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 <slave> 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);