On Wed, Oct 07, 2015 at 15:41 +0200, Mike Belopuhov wrote:
> Hi,
> 
> If you have noticed recent problems with trunk(4) please try the
> diff below as it fixes a subtle issue (not introduced by my changes!)
> with setting lladdr on non primary trunk ports: trunk_port_ioctl
> needs to be able to lookup the trunk port, but we didn't put it on
> the list yet, doh!
> 
> OK's are welcome as well.
> 

boo hoo, it clashes with some uncommitted changes, here's a rebased version.


diff --git sys/net/if_trunk.c sys/net/if_trunk.c
index 8678fe4..2aaa339 100644
--- sys/net/if_trunk.c
+++ sys/net/if_trunk.c
@@ -358,18 +358,18 @@ trunk_port_create(struct trunk_softc *tr, struct ifnet 
*ifp)
                tr->tr_primary = tp;
                tp->tp_flags |= TRUNK_PORT_MASTER;
                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);
 
        /* Add multicast addresses to this port */
        trunk_ether_cmdmulti(tp, SIOCADDMULTI);

Reply via email to