DHCPv6 is not concerned with link layer addresses.
authorflorian <florian@openbsd.org>
Sun, 2 Jun 2024 13:35:52 +0000 (13:35 +0000)
committerflorian <florian@openbsd.org>
Sun, 2 Jun 2024 13:35:52 +0000 (13:35 +0000)
pointed out by martijn

sbin/dhcp6leased/control.c
sbin/dhcp6leased/dhcp6leased.c
sbin/dhcp6leased/dhcp6leased.h
sbin/dhcp6leased/engine.c
sbin/dhcp6leased/frontend.c
sbin/dhcp6leased/parse.y
sbin/dhcp6leased/printconf.c

index 9ded313..5bc63c1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: control.c,v 1.1 2024/06/02 12:28:05 florian Exp $     */
+/*     $OpenBSD: control.c,v 1.2 2024/06/02 13:35:52 florian Exp $     */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -24,7 +24,6 @@
 
 #include <net/if.h>
 #include <netinet/in.h>
-#include <netinet/if_ether.h>
 
 #include <errno.h>
 #include <event.h>
index 0165e35..1884fb6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhcp6leased.c,v 1.1 2024/06/02 12:28:05 florian Exp $ */
+/*     $OpenBSD: dhcp6leased.c,v 1.2 2024/06/02 13:35:52 florian Exp $ */
 
 /*
  * Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
@@ -32,7 +32,6 @@
 #include <net/route.h>
 #include <net/if_dl.h>
 #include <netinet/in.h>
-#include <netinet/if_ether.h>
 #include <netinet6/in6_var.h>
 
 #include <arpa/inet.h>
index dc3c825..e974657 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhcp6leased.h,v 1.2 2024/06/02 12:41:46 florian Exp $ */
+/*     $OpenBSD: dhcp6leased.h,v 1.3 2024/06/02 13:35:52 florian Exp $ */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -217,7 +217,6 @@ struct imsg_ifinfo {
        int                     rdomain;
        int                     running;
        int                     link_state;
-       struct ether_addr       hw_address;
        char                    lease[LEASE_SIZE];
 };
 
index 96514fe..2a18022 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: engine.c,v 1.2 2024/06/02 12:41:46 florian Exp $      */
+/*     $OpenBSD: engine.c,v 1.3 2024/06/02 13:35:52 florian Exp $      */
 
 /*
  * Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
@@ -30,7 +30,6 @@
 #include <net/route.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#include <netinet/if_ether.h>
 #include <netinet/ip.h>
 #include <netinet/udp.h>
 
@@ -93,7 +92,6 @@ struct dhcp6leased_iface {
        uint32_t                         if_index;
        int                              rdomain;
        int                              running;
-       struct ether_addr                hw_address;
        int                              link_state;
        uint8_t                          xid[XID_SIZE];
        int                              serverid_len;
@@ -604,17 +602,9 @@ engine_update_iface(struct imsg_ifinfo *imsg_ifinfo)
                iface->rdomain = imsg_ifinfo->rdomain;
                iface->running = imsg_ifinfo->running;
                iface->link_state = imsg_ifinfo->link_state;
-               memcpy(&iface->hw_address, &imsg_ifinfo->hw_address,
-                   sizeof(struct ether_addr));
                LIST_INSERT_HEAD(&dhcp6leased_interfaces, iface, entries);
                need_refresh = 1;
        } else {
-               if (memcmp(&iface->hw_address, &imsg_ifinfo->hw_address,
-                   sizeof(struct ether_addr)) != 0) {
-                       memcpy(&iface->hw_address, &imsg_ifinfo->hw_address,
-                           sizeof(struct ether_addr));
-                       need_refresh = 1;
-               }
                if (imsg_ifinfo->rdomain != iface->rdomain) {
                        iface->rdomain = imsg_ifinfo->rdomain;
                        need_refresh = 1;
index 3fd768f..94f5ff0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: frontend.c,v 1.2 2024/06/02 12:41:46 florian Exp $    */
+/*     $OpenBSD: frontend.c,v 1.3 2024/06/02 13:35:52 florian Exp $    */
 
 /*
  * Copyright (c) 2017, 2021, 2024 Florian Obser <florian@openbsd.org>
@@ -32,7 +32,6 @@
 #include <net/route.h>
 
 #include <netinet/in.h>
-#include <netinet/if_ether.h>
 #include <netinet/ip.h>
 #include <netinet/udp.h>
 
@@ -555,15 +554,6 @@ update_iface(uint32_t if_index)
                switch (ifa->ifa_addr->sa_family) {
                case AF_LINK: {
                        struct if_data          *if_data;
-                       struct sockaddr_dl      *sdl;
-
-                       sdl = (struct sockaddr_dl *)ifa->ifa_addr;
-                       if ((sdl->sdl_type != IFT_ETHER &&
-                           sdl->sdl_type != IFT_CARP) ||
-                           sdl->sdl_alen != ETHER_ADDR_LEN)
-                               continue;
-                       memcpy(ifinfo.hw_address.ether_addr_octet,
-                           LLADDR(sdl), ETHER_ADDR_LEN);
 
                        if_data = (struct if_data *)ifa->ifa_data;
                        ifinfo.link_state = if_data->ifi_link_state;
@@ -580,7 +570,6 @@ update_iface(uint32_t if_index)
        if (iface == NULL) {
                if ((iface = calloc(1, sizeof(*iface))) == NULL)
                        fatal("calloc");
-               //iface->send_solicit = 1;
                memcpy(&iface->ifinfo, &ifinfo, sizeof(iface->ifinfo));
                LIST_INSERT_HEAD(&interfaces, iface, entries);
                frontend_imsg_compose_main(IMSG_OPEN_UDPSOCK, 0,
@@ -628,15 +617,6 @@ XXX
        ifinfo.running = (flags & (IFF_UP | IFF_RUNNING)) ==
            (IFF_UP | IFF_RUNNING);
 
-       if (sdl != NULL && (sdl->sdl_type == IFT_ETHER ||
-           sdl->sdl_type == IFT_CARP) && sdl->sdl_alen == ETHER_ADDR_LEN)
-               memcpy(ifinfo.hw_address.ether_addr_octet, LLADDR(sdl),
-                   ETHER_ADDR_LEN);
-       else if (iface == NULL) {
-               log_warnx("Could not find AF_LINK address for %s.", if_name);
-               return;
-       }
-
        if (iface == NULL) {
                if ((iface = calloc(1, sizeof(*iface))) == NULL)
                        fatal("calloc");
index 8fb7778..08943ef 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.1 2024/06/02 12:28:05 florian Exp $       */
+/*     $OpenBSD: parse.y,v 1.2 2024/06/02 13:35:52 florian Exp $       */
 
 /*
  * Copyright (c) 2018, 2024 Florian Obser <florian@openbsd.org>
@@ -31,7 +31,6 @@
 #include <net/if.h>
 
 #include <netinet/in.h>
-#include <netinet/if_ether.h>
 
 #include <arpa/inet.h>
 
index a38a652..7f69e2d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: printconf.c,v 1.1 2024/06/02 12:28:05 florian Exp $   */
+/*     $OpenBSD: printconf.c,v 1.2 2024/06/02 13:35:52 florian Exp $   */
 
 /*
  * Copyright (c) 2024 Florian Obser <florian@openbsd.org>
@@ -25,7 +25,6 @@
 #include <net/if.h>
 
 #include <netinet/in.h>
-#include <netinet/if_ether.h>
 
 #include <arpa/inet.h>