Hi Theo,

On 4/27/20 4:39 PM, Theo de Raadt wrote:
Is this code in umb_decode_ip_configuration() reached again, if
you do a late ifconfig (don't set inet6 at up time, but set it
later)

no, seting inet6 later doesn't work. On MBIM level I have to tell the device *before* the CONNECT whether I want IPv6 support or not. And there is no way to change that selection later on while we are connected.

The only way to do this transparently would be an implicit disconnect
followed by a reconnect in if_umb.c. But then I would need some trigger
that is called every time someone does 'ifconfig umb0 inet6 eui64' or 'ifconfig umb0 -inet6'. And I'm not sure whether the implicit temporary link loss is appreciated by the user.

Gerhard



That is how other network interfaces work.  I'm trying to make
sure this behaviour isn't too weird (ie. requiring a down, then up).

Gerhard Roth <gerhard_r...@genua.de> wrote:

And since IPv6 is now optional for umb(4), we can just skip
evaluation of the IPv6 part of the IP configuration, if it
wasn't enabled.

Gerhard


Index: sys/dev/usb/if_umb.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/if_umb.c,v
retrieving revision 1.33
diff -u -p -u -p -r1.33 if_umb.c
--- sys/dev/usb/if_umb.c        27 Apr 2020 11:16:51 -0000      1.33
+++ sys/dev/usb/if_umb.c        27 Apr 2020 13:56:09 -0000
@@ -1937,6 +1937,10 @@ tryv6:;
        /*
         * IPv6 configuation
         */
+       if ((sc->sc_flags & UMBFLG_NO_INET6) ||
+           in6ifa_ifpforlinklocal(GET_IFP(sc), 0) == NULL)
+               goto done;
+
        avail_v6 = letoh32(ic->ipv6_available);
        if (avail_v6 == 0) {
                if (ifp->if_flags & IFF_DEBUG)


Reply via email to