]> git.neil.brown.name Git - history.git/commitdiff
[BRIDGE]: handle out-of-ports corner case.
authorLennert Buytenhek <buytenh@gnu.org>
Thu, 6 Feb 2003 17:43:16 +0000 (09:43 -0800)
committerJames Morris <jmorris@intercode.com.au>
Thu, 6 Feb 2003 17:43:16 +0000 (09:43 -0800)
net/bridge/br_if.c

index d3b0f4a019242c5dd41bd2627057624a0be4d5f4..39427429bf564a5917adf18275abc1cc8cefb6b5 100644 (file)
@@ -155,8 +155,6 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, struct net_device
        p->path_cost = br_initial_port_cost(dev);
        p->priority = 0x80;
 
-       dev->br_port = p;
-
        for (i=1;i<255;i++)
                if (br_get_port(br, i) == NULL)
                        break;
@@ -166,6 +164,8 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, struct net_device
                return NULL;
        }
 
+       dev->br_port = p;
+
        p->port_no = i;
        br_init_port(p);
        p->state = BR_STATE_DISABLED;