summaryrefslogtreecommitdiff
path: root/sbin/slaacd/frontend.c
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-01-16 18:02:35 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-01-16 18:02:35 +0000
commit5589ae6b76bf31067071ab952cc7e3a95109d106 (patch)
tree4b8b896ca4e904abd62d0d45b45e1993c12acf95 /sbin/slaacd/frontend.c
parent8f75b3cfbb4fc32bf22cf0042322d709296a8f5c (diff)
Oops, fix previous.
We only want to recover the scope id if it hasn't already been recovered. But we want to always copy the link-local address.
Diffstat (limited to 'sbin/slaacd/frontend.c')
-rw-r--r--sbin/slaacd/frontend.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/slaacd/frontend.c b/sbin/slaacd/frontend.c
index f3777bf0205..a2d0c94d977 100644
--- a/sbin/slaacd/frontend.c
+++ b/sbin/slaacd/frontend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frontend.c,v 1.44 2021/01/16 17:45:45 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.45 2021/01/16 18:02:34 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -961,8 +961,9 @@ get_lladdr(char *if_name, struct ether_addr *mac, struct sockaddr_in6 *ll)
&sin6->sin6_addr.s6_addr[2]);
sin6->sin6_addr.s6_addr[2] =
sin6->sin6_addr.s6_addr[3] = 0;
- memcpy(ll, sin6, sizeof(*ll));
}
+ if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
+ memcpy(ll, sin6, sizeof(*ll));
break;
default:
break;