summaryrefslogtreecommitdiff
path: root/sbin/slaacd
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2024-04-21 17:33:06 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2024-04-21 17:33:06 +0000
commit26ec18cc41cf6efe24258b883cb06f2d0268d3a6 (patch)
treebb71254c9073eb5136e89e131b4944e46dc1c26e /sbin/slaacd
parent0ba65104e8c71a431eca60969a513e8ecfb7cb11 (diff)
Pass advertising router to the kernel.
We are using the ifra_dstaddr for this because it will always be unused with autoconf addresses since they can't be used on P2P links. OK bluhm
Diffstat (limited to 'sbin/slaacd')
-rw-r--r--sbin/slaacd/engine.c3
-rw-r--r--sbin/slaacd/engine.h3
-rw-r--r--sbin/slaacd/slaacd.c4
3 files changed, 7 insertions, 3 deletions
diff --git a/sbin/slaacd/engine.c b/sbin/slaacd/engine.c
index 000a9fcf413..bb10368527b 100644
--- a/sbin/slaacd/engine.c
+++ b/sbin/slaacd/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.88 2024/02/11 21:29:12 bluhm Exp $ */
+/* $OpenBSD: engine.c,v 1.89 2024/04/21 17:33:05 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -2130,6 +2130,7 @@ configure_address(struct address_proposal *addr_proposal)
address.if_index = addr_proposal->if_index;
memcpy(&address.addr, &addr_proposal->addr, sizeof(address.addr));
+ memcpy(&address.gw, &addr_proposal->from, sizeof(address.gw));
memcpy(&address.mask, &addr_proposal->mask, sizeof(address.mask));
address.vltime = addr_proposal->vltime;
address.pltime = addr_proposal->pltime;
diff --git a/sbin/slaacd/engine.h b/sbin/slaacd/engine.h
index 7a8551d2c50..cf439884927 100644
--- a/sbin/slaacd/engine.h
+++ b/sbin/slaacd/engine.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.h,v 1.6 2021/03/21 18:25:24 florian Exp $ */
+/* $OpenBSD: engine.h,v 1.7 2024/04/21 17:33:05 florian Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -19,6 +19,7 @@
struct imsg_configure_address {
uint32_t if_index;
struct sockaddr_in6 addr;
+ struct sockaddr_in6 gw;
struct in6_addr mask;
uint32_t vltime;
uint32_t pltime;
diff --git a/sbin/slaacd/slaacd.c b/sbin/slaacd/slaacd.c
index 4d1786361f7..05af06e68de 100644
--- a/sbin/slaacd/slaacd.c
+++ b/sbin/slaacd/slaacd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slaacd.c,v 1.68 2023/02/15 13:47:00 florian Exp $ */
+/* $OpenBSD: slaacd.c,v 1.69 2024/04/21 17:33:05 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -632,6 +632,8 @@ configure_interface(struct imsg_configure_address *address)
memcpy(&in6_addreq.ifra_addr, &address->addr,
sizeof(in6_addreq.ifra_addr));
+ memcpy(&in6_addreq.ifra_dstaddr, &address->gw,
+ sizeof(in6_addreq.ifra_dstaddr));
memcpy(&in6_addreq.ifra_prefixmask.sin6_addr, &address->mask,
sizeof(in6_addreq.ifra_prefixmask.sin6_addr));
in6_addreq.ifra_prefixmask.sin6_family = AF_INET6;