Pass advertising router to the kernel.
authorflorian <florian@openbsd.org>
Sun, 21 Apr 2024 17:33:05 +0000 (17:33 +0000)
committerflorian <florian@openbsd.org>
Sun, 21 Apr 2024 17:33:05 +0000 (17:33 +0000)
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

sbin/slaacd/engine.c
sbin/slaacd/engine.h
sbin/slaacd/slaacd.c

index 000a9fc..bb10368 100644 (file)
@@ -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;
index 7a8551d..cf43988 100644 (file)
@@ -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;
index 4d17863..05af06e 100644 (file)
@@ -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;