-/* $OpenBSD: route.c,v 1.251 2020/12/29 19:50:51 benno Exp $ */
+/* $OpenBSD: route.c,v 1.252 2021/01/24 08:58:50 florian Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
errx(1, "%s: resolved to multiple values", s);
memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6));
freeaddrinfo(res);
+#ifdef __KAME__
if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) ||
IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) ||
IN6_IS_ADDR_MC_INTFACELOCAL(&su->sin6.sin6_addr)) &&
htons(su->sin6.sin6_scope_id);
su->sin6.sin6_scope_id = 0;
}
+#endif
if (hints.ai_flags == AI_NUMERICHOST) {
if (which == RTA_DST) {
if (sep == NULL && su->sin6.sin6_scope_id == 0 &&
-/* $OpenBSD: show.c,v 1.117 2021/01/16 17:41:20 claudio Exp $ */
+/* $OpenBSD: show.c,v 1.118 2021/01/24 08:58:50 florian Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
case AF_INET6:
{
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
+#ifdef __KAME__
struct in6_addr *in6 = &sa6->sin6_addr;
/*
&in6->s6_addr[2]);
*(u_short *)&in6->s6_addr[2] = 0;
}
+#endif
if (flags & RTF_HOST)
cp = routename((struct sockaddr *)sa6);
else
memcpy(&sin6, sa, sa->sa_len);
sin6.sin6_len = sizeof(struct sockaddr_in6);
sin6.sin6_family = AF_INET6;
+#ifdef __KAME__
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
sin6.sin6_addr.s6_addr[2] = 0;
sin6.sin6_addr.s6_addr[3] = 0;
}
+#endif
return (routename6(&sin6));
}
-/* $OpenBSD: show.c,v 1.57 2021/01/16 17:42:52 claudio Exp $ */
+/* $OpenBSD: show.c,v 1.58 2021/01/24 08:58:50 florian Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
case AF_INET6:
{
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
+#ifdef __KAME__
struct in6_addr *in6 = &sa6->sin6_addr;
/*
&in6->s6_addr[2]);
*(u_short *)&in6->s6_addr[2] = 0;
}
+#endif
if (flags & RTF_HOST)
cp = routename((struct sockaddr *)sa6);
else
memset(&sin6, 0, sizeof(sin6));
memcpy(&sin6, sa, sa->sa_len);
sin6.sin6_family = AF_INET6;
+#ifdef __KAME__
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
sin6.sin6_addr.s6_addr[2] = 0;
sin6.sin6_addr.s6_addr[3] = 0;
}
+#endif
return (routename6(&sin6));
}