summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-01-17 15:39:18 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-01-17 15:39:18 +0000
commitf88988a59b357d87a83a21be7bad123a853668ff (patch)
treebfba300127dc71d6ad0cebd00caa9f59d9593c85 /sbin
parent6a4f30308eefd922b7f297530d729f064fc0e517 (diff)
Mark up locations of KAME hack with #ifdef __KAME__ so that we can
find it again if and when we no longer need it. No object change.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/slaacd/frontend.c6
-rw-r--r--sbin/slaacd/slaacd.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/sbin/slaacd/frontend.c b/sbin/slaacd/frontend.c
index a2d0c94d977..ff6539b9ff5 100644
--- a/sbin/slaacd/frontend.c
+++ b/sbin/slaacd/frontend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frontend.c,v 1.45 2021/01/16 18:02:34 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.46 2021/01/17 15:39:17 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -878,6 +878,7 @@ handle_route_message(struct rt_msghdr *rtm, struct sockaddr **rti_info)
memcpy(&del_route.gw, rti_info[RTAX_GATEWAY],
sizeof(del_route.gw));
in6 = &del_route.gw.sin6_addr;
+#ifdef __KAME__
/* XXX from route(8) p_sockaddr() */
if ((IN6_IS_ADDR_LINKLOCAL(in6) ||
IN6_IS_ADDR_MC_LINKLOCAL(in6) ||
@@ -887,6 +888,7 @@ handle_route_message(struct rt_msghdr *rtm, struct sockaddr **rti_info)
(u_int32_t)ntohs(*(u_short *) &in6->s6_addr[2]);
*(u_short *)&in6->s6_addr[2] = 0;
}
+#endif
frontend_imsg_compose_engine(IMSG_DEL_ROUTE,
0, 0, &del_route, sizeof(del_route));
log_debug("RTM_DELETE: %s[%u]", if_name,
@@ -955,6 +957,7 @@ get_lladdr(char *if_name, struct ether_addr *mac, struct sockaddr_in6 *ll)
break;
case AF_INET6:
sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
+#ifdef __KAME__
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) &&
sin6->sin6_scope_id == 0) {
sin6->sin6_scope_id = ntohs(*(u_int16_t *)
@@ -962,6 +965,7 @@ get_lladdr(char *if_name, struct ether_addr *mac, struct sockaddr_in6 *ll)
sin6->sin6_addr.s6_addr[2] =
sin6->sin6_addr.s6_addr[3] = 0;
}
+#endif
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
memcpy(ll, sin6, sizeof(*ll));
break;
diff --git a/sbin/slaacd/slaacd.c b/sbin/slaacd/slaacd.c
index 2504dcec326..faf4edad31c 100644
--- a/sbin/slaacd/slaacd.c
+++ b/sbin/slaacd/slaacd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slaacd.c,v 1.53 2020/12/01 18:08:53 florian Exp $ */
+/* $OpenBSD: slaacd.c,v 1.54 2021/01/17 15:39:17 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -754,9 +754,11 @@ configure_gateway(struct imsg_configure_dfr *dfr, uint8_t rtm_type)
}
memcpy(&gw, &dfr->addr, sizeof(gw));
+#ifdef __KAME__
/* from route(8) getaddr()*/
*(u_int16_t *)& gw.sin6_addr.s6_addr[2] = htons(gw.sin6_scope_id);
gw.sin6_scope_id = 0;
+#endif
iov[iovcnt].iov_base = &gw;
iov[iovcnt++].iov_len = sizeof(gw);
rtm.rtm_msglen += sizeof(gw);