From: florian Date: Sat, 20 Mar 2021 17:11:49 +0000 (+0000) Subject: RFC 8981 allows the configuration of only temporary IPv6 addresses. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f7cbc8fb06329d0fc96cdfc665690638aea65058;p=openbsd RFC 8981 allows the configuration of only temporary IPv6 addresses. Keep "temporary" the default when setting inet6 autoconf but make it possible to disable the "autoconf" flag but keep "temporary" enabled. The normal usecase to only have temporary autoconf addresses would be "inet6 temporary" in hostname.if OK kn --- diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 2c60e652675..c527dadadaf 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.441 2021/03/16 19:24:36 kn Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.442 2021/03/20 17:11:49 florian Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -1579,8 +1579,11 @@ setautoconf(const char *cmd, int val) setifxflags("inet", val * IFXF_AUTOCONF4); break; case AF_INET6: - setifxflags("inet6", val * (IFXF_AUTOCONF6 | - IFXF_AUTOCONF6TEMP)); + if (val > 0) + setifxflags("inet6", (IFXF_AUTOCONF6 | + IFXF_AUTOCONF6TEMP)); + else + setifxflags("inet6", -IFXF_AUTOCONF6); break; default: errx(1, "autoconf not allowed for this address family");