nothing else does, and i want to clean up the code. ok?
Index: if_trunk.c =================================================================== RCS file: /cvs/src/sys/net/if_trunk.c,v retrieving revision 1.137 diff -u -p -r1.137 if_trunk.c --- if_trunk.c 12 Aug 2018 23:50:31 -0000 1.137 +++ if_trunk.c 9 Jan 2019 02:55:32 -0000 @@ -282,7 +282,6 @@ trunk_port_lladdr(struct trunk_port *tp, int trunk_port_create(struct trunk_softc *tr, struct ifnet *ifp) { - struct trunk_softc *tr_ptr; struct trunk_port *tp; int error = 0; @@ -317,18 +316,6 @@ trunk_port_create(struct trunk_softc *tr if ((tp = malloc(sizeof *tp, M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) return (ENOMEM); - /* Check if port is a stacked trunk */ - SLIST_FOREACH(tr_ptr, &trunk_list, tr_entries) { - if (ifp == &tr_ptr->tr_ac.ac_if) { - tp->tp_flags |= TRUNK_PORT_STACK; - if (trunk_port_checkstacking(tr_ptr) >= - TRUNK_MAX_STACKING) { - free(tp, M_DEVBUF, sizeof *tp); - return (E2BIG); - } - } - } - /* Change the interface type */ tp->tp_iftype = ifp->if_type; ifp->if_type = IFT_IEEE8023ADLAG; @@ -380,23 +367,6 @@ trunk_port_create(struct trunk_softc *tr if_ih_insert(ifp, trunk_input, tp); return (error); -} - -int -trunk_port_checkstacking(struct trunk_softc *tr) -{ - struct trunk_softc *tr_ptr; - struct trunk_port *tp; - int m = 0; - - SLIST_FOREACH(tp, &tr->tr_ports, tp_entries) { - if (tp->tp_flags & TRUNK_PORT_STACK) { - tr_ptr = (struct trunk_softc *)tp->tp_if->if_softc; - m = MAX(m, trunk_port_checkstacking(tr_ptr)); - } - } - - return (m + 1); } int Index: if_trunk.h =================================================================== RCS file: /cvs/src/sys/net/if_trunk.h,v retrieving revision 1.26 diff -u -p -r1.26 if_trunk.h --- if_trunk.h 12 Aug 2018 23:50:31 -0000 1.26 +++ if_trunk.h 9 Jan 2019 02:55:32 -0000 @@ -25,7 +25,6 @@ #define TRUNK_MAX_PORTS 32 /* logically */ #define TRUNK_MAX_NAMESIZE 32 /* name of a protocol */ -#define TRUNK_MAX_STACKING 4 /* maximum number of stacked trunks */ /* Port flags */ #define TRUNK_PORT_SLAVE 0x00000000 /* normal enslaved port */