summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2021-03-20 17:11:49 +0000
committerflorian <florian@openbsd.org>2021-03-20 17:11:49 +0000
commitf7cbc8fb06329d0fc96cdfc665690638aea65058 (patch)
tree164cd7ee36e517f9dfb080298abb33ba09225022 /sbin
parentRFC 8981 allows the configuration of only temporary IPv6 addresses. (diff)
downloadwireguard-openbsd-f7cbc8fb06329d0fc96cdfc665690638aea65058.tar.xz
wireguard-openbsd-f7cbc8fb06329d0fc96cdfc665690638aea65058.zip
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
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c9
1 files changed, 6 insertions, 3 deletions
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");