diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-06-25 22:22:07 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-06-25 22:22:07 +0000 |
commit | 92b271bd4bfe637ca5dabe7e31f29c833851cb57 (patch) | |
tree | cebf78251239211457203e72f1c817284607303a | |
parent | dc9bb44d82a2eacca3028b696726881b19e1b871 (diff) |
Make ifconfig(8) default to prefixlen 128 when setting an IPv6 destination
address on a point-to-point interface. Makes it easier to configure IPv6 on
interfaces such as gif(4). Specifying 'prefixlen 128' is no longer required.
This is consistent with IPv4 where a netmask is not required either.
ok mpi@ bluhm@ benno@
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index a9389975739..d99bcb34871 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.344 2017/06/08 19:23:39 tedu Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.345 2017/06/25 22:22:06 stsp Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -803,9 +803,13 @@ nextarg: /* * Aggregatable address architecture defines all prefixes * are 64. So, it is convenient to set prefixlen to 64 if - * it is not specified. + * it is not specified. If we are setting a destination + * address on a point-to-point interface, 128 is required. */ - setifprefixlen("64", 0); + if (setipdst && (flags & IFF_POINTOPOINT)) + setifprefixlen("128", 0); + else + setifprefixlen("64", 0); /* in6_getprefix("64", MASK) if MASK is available here... */ } @@ -1241,6 +1245,7 @@ void setifdstaddr(const char *addr, int param) { setaddr++; + setipdst++; afp->af_getaddr(addr, DSTADDR); } |