Hello Claudio,

On Mon, 27 Apr 2020 11:51:50 +0200 Claudio Jeker <cje...@diehard.n-r-g.com> 
wrote:
> On Mon, Apr 27, 2020 at 10:26:01AM +0200, Gerhard Roth wrote:
> > Should we change umb(4) so that it only grabs an IPv6 address
> > in case somebody does a "ifconfig umb0 inet6 eui64" first?
> > 
> > Anyone willing to ok the patch below?  
> 
> see below
>  
> > On 2/19/20 9:19 AM, Gerhard Roth wrote:  
> > > On Wed, 19 Feb 2020 08:45:39 +0100 Claudio Jeker 
> > > <cje...@diehard.n-r-g.com> wrote:  
> > > > On Tue, Feb 18, 2020 at 11:16:54PM +0000, Stuart Henderson wrote:  
> > > > > On 2020/02/18 13:40, Gerhard Roth wrote:  
> > > > > > > > Yes, I tried MBIM_CONTEXT_IPTYPE_IPV4ANDV6 myself first but to 
> > > > > > > > no
> > > > > > > > avail. The switched to MBIM_CONTEXT_IPTYPE_IPV4V6 and everything
> > > > > > > > was fine.  
> > > > > > > 
> > > > > > > Obviously it needs to switch based on INET6, but with the current
> > > > > > > mechanism used for handling v6 in OpenBSD, shouldn't it disable v6
> > > > > > > unless the interface has a link-local configured? (So the usual 
> > > > > > > method
> > > > > > > to enable v6 and bring an interface up would be "inet6 eui64" and 
> > > > > > > "up").
> > > > > > > That is how pppoe works.  
> > > > > > 
> > > > > > 
> > > > > > Hi Stuart,
> > > > > > 
> > > > > > you mean like that?  
> > > > > 
> > > > > Yes, that looks right - sorry I don't have a working umb to test 
> > > > > though!  
> > > > 
> > > > I guess we should then also adjust the manpage to make sure people know
> > > > how to enable IPv6 in hostname.umb0  
> > > 
> > > 
> > > Took a look at pppoe.4 and tried to extract what is needed for umb.4.
> > > Updated diff below.
> > > 
> > > Gerhard
> > > 
> > > 
> > > Index: share/man/man4/umb.4
> > > ===================================================================
> > > RCS file: /cvs/src/share/man/man4/umb.4,v
> > > retrieving revision 1.10
> > > diff -u -p -u -p -r1.10 umb.4
> > > --- share/man/man4/umb.4  18 Feb 2020 08:09:37 -0000      1.10
> > > +++ share/man/man4/umb.4  19 Feb 2020 08:14:01 -0000
> > > @@ -40,6 +40,19 @@ will remain in this state until the MBIM
> > >   In case the device is connected to an "always-on" USB port,
> > >   it may be possible to connect to a provider without entering the
> > >   PIN again even if the system was rebooted.
> > > +.Pp
> > > +To use IPv6, configure a link-local address before bringing
> > > +the interface up.
> > > +Some devices require the
> > > +.Sy AUTOCONF6
> > > +flag on the interface.  
> 
> I think I asked this already, how does one know if autoconf is needed or
> not. Is that only device specific or also provider dependent?
> Adding autoconf will enable slaacd(8) on the device. What kind of troubles
> could result from this on a device that do not need it?
> In general this paragraph does not really help me to understand the
> situation better.

Basically, the MBIM protocol allows us to obtain the IPv6
address the ISP has given to us with the MBIM_CID_IP_CONFIGURATION
query. And all the provider I've met have done so, so far.

Yet job@ had a Japanese ISP that didn't give any IP address
via the MBIM protocol but wanted us to use regular IPv6
protocols to obtain the IP address.

Now this is a little bit too much detail for a man page.
And there is no technical way to find out what is required apart
from trial and error.

So I rephrased the sentence to:

        If the device is able to connect to the ISP's network
        but doesn't show an IPv6 address, setting the
        AUTOCONF6 on the interface before bringing it up may help.

(see updated diff below)
Does that sound better?

> 
> > > +.Pp
> > > +A typical
> > > +.Pa /etc/hostname.umb0
> > > +looks like this:
> > > +.Bd -literal -offset indent
> > > +pin 1234 apn ISP-APN-Name inet6 eui64 autoconf -roaming up
> > > +.Ed  
> 
> In my opinion this is a bad example, it mixes a lot of different options
> which are not explained to the user in that man page. Also I think it is
> bad practice to put everything on one line. ifconfig(8) is rather
> sensitive when it comes to multiple commands in a single invocation.
> If I look at this and compare it with my hostname.umb0 file
> pin 1111
> up
> I have more questions, what is apn and why would I need, where do I find
> what I need to put there. ifconfig umb0 does not show anything named apn.

The Access Point Name (APN) shows up in ifconfig as soon as you
set one. Explaining the meaning of the APN is IMHO beyond the
scope of a section 4 man page. For example, we don't explain
the meaning of SSID for WiFi, either.


> Also why is -roaming after inet6 eui64 autoconf? Isn't -roaming default?
> 
> Ideally the first paragraph explains the IPv6 setup well enough that no
> example config is needed here.

Ok, removed the example.


> 
> > >   .Sh HARDWARE
> > >   The following devices should work:
> > >   .Pp
> > > Index: sys/dev/usb/if_umb.c
> > > ===================================================================
> > > RCS file: /cvs/src/sys/dev/usb/if_umb.c,v
> > > retrieving revision 1.32
> > > diff -u -p -u -p -r1.32 if_umb.c
> > > --- sys/dev/usb/if_umb.c  18 Feb 2020 08:09:37 -0000      1.32
> > > +++ sys/dev/usb/if_umb.c  18 Feb 2020 12:35:45 -0000
> > > @@ -2583,7 +2583,8 @@ umb_send_connect(struct umb_softc *sc, i
> > >           c->iptype = htole32(MBIM_CONTEXT_IPTYPE_IPV4);
> > >   #ifdef INET6
> > >           /* XXX FIXME: support IPv6-only mode, too */
> > > - if ((sc->sc_flags & UMBFLG_NO_INET6) == 0)
> > > + if ((sc->sc_flags & UMBFLG_NO_INET6) == 0 &&
> > > +     in6ifa_ifpforlinklocal(GET_IFP(sc), 0) != NULL)
> > >                   c->iptype = htole32(MBIM_CONTEXT_IPTYPE_IPV4V6);
> > >   #endif
> > >           memcpy(c->context, umb_uuid_context_internet, sizeof 
> > > (c->context));
> > >   
> 
> The code diff is fine by me.

Thanks, change committed.


Here the updated man page:

Index: share/man/man4/umb.4
===================================================================
RCS file: /cvs/src/share/man/man4/umb.4,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 umb.4
--- share/man/man4/umb.4        18 Feb 2020 08:09:37 -0000      1.10
+++ share/man/man4/umb.4        27 Apr 2020 11:03:29 -0000
@@ -40,6 +40,14 @@ will remain in this state until the MBIM
 In case the device is connected to an "always-on" USB port,
 it may be possible to connect to a provider without entering the
 PIN again even if the system was rebooted.
+.Pp
+To use IPv6, configure a link-local address before bringing
+the interface up.
+If the device is able to connect to the ISP's network but doesn't
+show an IPv6 address, setting the
+.Sy AUTOCONF6
+flag on the interface before bringing it up may help.
+.Ed
 .Sh HARDWARE
 The following devices should work:
 .Pp

Reply via email to