On Thu, Sep 15, 2016 at 18:16 +0200, Martin Pieuchot wrote:
> On 15/09/16(Thu) 14:58, Olivier Cherrier wrote:
> > # for i in oce0 oce1 trunk0 vlan20; do
> > trunk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> >         hwfeatures=10000<> hardmtu 1500
>                       ^^^^^^
> 
> Why your trunk(4) does not have VLAN_MTU?   That might be the bug.
> 

Indeed.
When he does "trunkport oce0 trunkport oce1 trunkproto loadbalance"
in this order, the roundrobin (default) trunk is created and then
it's changed to the loadbalancing one as the last step.  The problem
is that the trunk discipline attach function clears tr_capabilities
and we need to manualy run the function that fetches the right value.
The workaround is to do "trunkproto loadbalance trunkport oce0
trunkport oce1".

I think I have introduced this bug in Varazdin...

diff --git sys/net/if_trunk.c sys/net/if_trunk.c
index 7b30193..5b67db2 100644
--- sys/net/if_trunk.c
+++ sys/net/if_trunk.c
@@ -662,8 +662,7 @@ trunk_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
                        error = tr->tr_detach(tr);
                if (error != 0)
                        break;
-               for (i = 0; i < (sizeof(trunk_protos) /
-                   sizeof(trunk_protos[0])); i++) {
+               for (i = 0; i < nitems(trunk_protos); i++) {
                        if (trunk_protos[i].ti_proto == ra->ra_proto) {
                                if (tr->tr_ifflags & IFF_DEBUG)
                                        printf("%s: using proto %u\n",
@@ -675,6 +674,8 @@ trunk_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
                                SLIST_FOREACH(tp, &tr->tr_ports, tp_entries)
                                        if_ih_insert(tp->tp_if,
                                            trunk_input, tp);
+                               /* Update trunk capabilities */
+                               tr->tr_capabilities = trunk_capabilities(tr);
                                goto out;
                        }
                }

Reply via email to