Make sure that when trunk_port_ioctl is called to set a new
authormikeb <mikeb@openbsd.org>
Thu, 8 Oct 2015 13:58:07 +0000 (13:58 +0000)
committermikeb <mikeb@openbsd.org>
Thu, 8 Oct 2015 13:58:07 +0000 (13:58 +0000)
lladdr the trunk port is already on the list.

OK mpi

sys/net/if_trunk.c

index 4285dbe..2c2d82d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_trunk.c,v 1.120 2015/10/08 11:39:59 dlg Exp $      */
+/*     $OpenBSD: if_trunk.c,v 1.121 2015/10/08 13:58:07 mikeb Exp $    */
 
 /*
  * Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -360,14 +360,14 @@ trunk_port_create(struct trunk_softc *tr, struct ifnet *ifp)
                trunk_lladdr(&tr->tr_ac, tp->tp_lladdr);
        }
 
-       /* Update link layer address for this port */
-       trunk_port_lladdr(tp,
-           ((struct arpcom *)(tr->tr_primary->tp_if))->ac_enaddr);
-
        /* Insert into the list of ports */
        SLIST_INSERT_HEAD(&tr->tr_ports, tp, tp_entries);
        tr->tr_count++;
 
+       /* Update link layer address for this port */
+       trunk_port_lladdr(tp,
+           ((struct arpcom *)(tr->tr_primary->tp_if))->ac_enaddr);
+
        /* Update trunk capabilities */
        tr->tr_capabilities = trunk_capabilities(tr);