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
-/* $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 $ */
/*
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");