summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ndp
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2019-12-19 18:36:37 +0000
committerbluhm <bluhm@openbsd.org>2019-12-19 18:36:37 +0000
commitfb5a4c327fb280b2cbd3b20a69e227fb54e260d0 (patch)
tree75b4ac9733992dbb3fdb9a2092614928fe1e779f /usr.sbin/ndp
parentConvert boolean_t/TRUE/FALSE to int/1/0 for coherency with the rest of (diff)
downloadwireguard-openbsd-fb5a4c327fb280b2cbd3b20a69e227fb54e260d0.tar.xz
wireguard-openbsd-fb5a4c327fb280b2cbd3b20a69e227fb54e260d0.zip
In ndp(8) the scope ID was not set correctly so it touches the wrong
route. In parse_host() s6_addr is type u_int8_t, but we have to write a 16 bit value. Add a cast to fix ndp -c. reported by Matthias Pitzl; OK kn@
Diffstat (limited to 'usr.sbin/ndp')
-rw-r--r--usr.sbin/ndp/ndp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
index acb9028158b..04f72adc9ad 100644
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ndp.c,v 1.98 2019/08/31 13:46:14 bluhm Exp $ */
+/* $OpenBSD: ndp.c,v 1.99 2019/12/19 18:36:37 bluhm Exp $ */
/* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */
/*
@@ -313,7 +313,7 @@ parse_host(const char *host, struct in6_addr *in6)
*in6 = sin6->sin6_addr;
#ifdef __KAME__
if (IN6_IS_ADDR_LINKLOCAL(in6)) {
- in6->s6_addr[2] = htons(sin6->sin6_scope_id);
+ *(u_int16_t *)&in6->s6_addr[2] = htons(sin6->sin6_scope_id);
}
#endif