From: mikeb Date: Thu, 8 Oct 2015 13:58:07 +0000 (+0000) Subject: Make sure that when trunk_port_ioctl is called to set a new X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=603114795bb15779359e2812eda1e9fe51a74a33;p=openbsd Make sure that when trunk_port_ioctl is called to set a new lladdr the trunk port is already on the list. OK mpi --- diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 4285dbe0d12..2c2d82d64ed 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -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 @@ -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);