Penned by Henning Brauer on 20140608 10:14.46, we have: | since no consensus could be found yet for a new command line option to | ifconfig, heck, not even about wether it is needed, I propose this for | now. | | 1) make "ifconfig <if> inet6 eui64" reset the NOINET6 flag | unconditionally, so a link-local will be assigned if there isn't one | yet. | | Index: sbin/ifconfig/ifconfig.c | =================================================================== | RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v | retrieving revision 1.283 | diff -u -p -r1.283 ifconfig.c | --- sbin/ifconfig/ifconfig.c 12 May 2014 08:47:37 -0000 1.283 | +++ sbin/ifconfig/ifconfig.c 19 May 2014 00:27:07 -0000 | @@ -411,7 +411,7 @@ const struct cmd { | { "flowdst", NEXTARG, 0, setpflow_receiver }, | { "-flowdst", 1, 0, unsetpflow_receiver }, | { "pflowproto", NEXTARG, 0, setpflowproto }, | - { "-inet6", IFXF_NOINET6, 0, setifxflags } , | + { "-inet6", IFXF_NOINET6, 0, setifxflags }, | { "keepalive", NEXTARG2, 0, NULL, setkeepalive }, | { "-keepalive", 1, 0, unsetkeepalive }, | { "add", NEXTARG, 0, bridge_add }, | @@ -1312,6 +1312,7 @@ setia6eui64(const char *cmd, int val) | | if (afp->af_af != AF_INET6) | errx(1, "%s not allowed for the AF", cmd); | + setifxflags("inet6", -IFXF_NOINET6); | in6 = (struct in6_addr *)&in6_addreq.ifra_addr.sin6_addr; | if (memcmp(&in6addr_any.s6_addr[8], &in6->s6_addr[8], 8) != 0) | errx(1, "interface index is already filled"); | | 2) turn the NOINET6 flag on by default. | As said previously, it will be reset and thus a link-local assigned | transparently if either | -rtsol(d) is run | -an inet6 address is assigned | -ifconfig <if> inet6 eui64 is run | and thus should be entirely transparent for the vast majority of inet6 | users. | | Index: sys/net/if.c | =================================================================== | RCS file: /cvs/src/sys/net/if.c,v | retrieving revision 1.289 | diff -u -p -r1.289 if.c | --- sys/net/if.c 16 May 2014 08:21:54 -0000 1.289 | +++ sys/net/if.c 16 May 2014 14:15:24 -0000 | @@ -423,6 +423,9 @@ if_attach(struct ifnet *ifp) | #else | TAILQ_INSERT_TAIL(&ifnet, ifp, if_list); | #endif | +#ifdef INET6 | + ifp->if_xflags |= IFXF_NOINET6; | +#endif | | m_clinitifp(ifp); | | wether we need a less obscure ifconfig command than eui64 can be | discussed after. | | oks?
ok todd@ -- Todd T. Fries . http://todd.fries.net/pgp.txt . @unix2mars . github:toddfries