summaryrefslogtreecommitdiff
path: root/sbin/route/show.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-01-16 17:41:21 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-01-16 17:41:21 +0000
commit1c9c87b63c6d17bf997a781d8357ebb4c1d9f24d (patch)
treed8d1477aecf0108ea09306f59b1bb6e346bfd537 /sbin/route/show.c
parent699c5253c6e25a5703076b481ebae52cc4a19160 (diff)
Only recover the KAME embedded scope if the sin6_scope_id filed is
not initalized. If it is set assume that the scope was already recovered. This is required to get rid of all this scope madness in the long run. OK bluhm@ florian@
Diffstat (limited to 'sbin/route/show.c')
-rw-r--r--sbin/route/show.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c
index 6aae8655dc8..15b9a12503a 100644
--- a/sbin/route/show.c
+++ b/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.116 2020/10/29 21:15:26 denis Exp $ */
+/* $OpenBSD: show.c,v 1.117 2021/01/16 17:41:20 claudio Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -392,9 +392,10 @@ p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
* XXX: This is a special workaround for KAME kernels.
* sin6_scope_id field of SA should be set in the future.
*/
- if (IN6_IS_ADDR_LINKLOCAL(in6) ||
+ if ((IN6_IS_ADDR_LINKLOCAL(in6) ||
IN6_IS_ADDR_MC_LINKLOCAL(in6) ||
- IN6_IS_ADDR_MC_INTFACELOCAL(in6)) {
+ IN6_IS_ADDR_MC_INTFACELOCAL(in6)) &&
+ sa6->sin6_scope_id == 0) {
/* XXX: override is ok? */
sa6->sin6_scope_id = (u_int32_t)ntohs(*(u_short *)
&in6->s6_addr[2]);