diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2018-03-13 13:58:04 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2018-03-13 13:58:04 +0000 |
commit | 4bb461324e01c4a9507f3762bb52289516fb0498 (patch) | |
tree | 59bcd3793a1af089711345bd8752c6d4758a701e /sys | |
parent | 525e3ea9b200e2f2a4f0206023f3539e3a5e5212 (diff) |
Calculate RFC7217 link-local style addresses the same way as
slaacd(8).
RFC 7217 states (section 5, page 9):
| The Interface Identifier is finally obtained by taking as many
| bits from the RID value (computed in the previous step) as
| necessary, starting from the least significant bit.
Problem in slaacd pointed out by semarie@.
OK sthen, phessler
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 0aa10fad94b..a920342499c 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_ifattach.c,v 1.105 2018/02/10 05:52:08 florian Exp $ */ +/* $OpenBSD: in6_ifattach.c,v 1.106 2018/03/13 13:58:03 florian Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -244,7 +244,7 @@ in6_get_soii_ifid(struct ifnet *ifp, struct in6_addr *in6) SHA512Update(&ctx, ip6_soiikey, sizeof(ip6_soiikey)); SHA512Final(digest, &ctx); - bcopy(digest, &in6->s6_addr[8], 8); + bcopy(digest + (sizeof(digest) - 8), &in6->s6_addr[8], 8); return 0; } |