[What I'm pointing out below looks like a mistake regardless of the variables in scope.]
On Wed, Oct 22, 2014 at 1:40 AM, Henning Brauer <hb-openbsdt...@ml.bsws.de> wrote: > * Chris Cappuccio <ch...@nmedia.net> [2014-10-22 01:11]: >> Stuart Henderson [st...@openbsd.org] wrote: >> > Any comments on the diff in this? >> > >> > > +#ifdef INET6 >> > > + sc->sc_sppp.pp_if.if_xflags &= ~IFXF_NOINET6; >> > > +#endif >> Aside from what Stefan said, isn't this flag going to be removed >> in favor of a flag that explicitly enables INET6 for interfaces? > > remove yes, no need for a new one. > > Index: sbin/ifconfig/ifconfig.c > =================================================================== > RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v > retrieving revision 1.287 > diff -u -p -r1.287 ifconfig.c > --- sbin/ifconfig/ifconfig.c 12 Jul 2014 19:58:17 -0000 1.287 > +++ sbin/ifconfig/ifconfig.c 3 Oct 2014 12:58:22 -0000 > @@ -148,6 +148,7 @@ void setiflladdr(const char *, int); [...] > void > +addaf(const char *vname, int value) > +{ ^ *v*name > + struct if_afreq ifar; > + > + strlcpy(ifar.ifar_name, name, sizeof(ifar.ifar_name)); ^ name > + ifar.ifar_af = value; > + if (ioctl(s, SIOCIFAFATTACH, (caddr_t)&ifar) < 0) > + warn("SIOCIFAFATTACH"); > +} > + > +void > removeaf(const char *vname, int value) > { ^ *v*name > - switch (value) { > -#ifdef INET6 > - case AF_INET6: > - setifxflags(vname, IFXF_NOINET6); > - setifxflags(vname, -IFXF_AUTOCONF6); > - break; > -#endif > - default: > - errx(1, "removeaf not implemented for this AF"); > - } > + struct if_afreq ifar; > + > + strlcpy(ifar.ifar_name, name, sizeof(ifar.ifar_name)); ^ name > + ifar.ifar_af = value; > + if (ioctl(s, SIOCIFAFDETACH, (caddr_t)&ifar) < 0) > + warn("SIOCIFAFDETACH"); > }