Thanks for the patch.

This works, but with some weird behavior.

First, it doesn't work directly at boot. I have to run `sh /etc/netstart carp0` to make it work.

Then, For some weird reason, when I execute that on the master node, the dynamic IP is attributed to the CARP interface, but it gets demoted and becomes backup. On the other node, the CARP interface has become master all right, but the dynamic IP isn't attributed. I have to execute `sh /etc/netstart carp0` on this node too. Maybe that's more of a CARP issue rather than a dhcpleased one.

After that the CARP behave correctly as far as I saw.

Guy Godfroy

Le 15/10/2021 à 13:39, Florian Obser a écrit :
On 2021-10-15 09:17 +02, Guy Godfroy <[email protected]> wrote:
Synopsis:       dhcpleased unable to work on CARP interface
Category:       system
Environment:
        System      : OpenBSD 7.0
        Details     : OpenBSD 7.0 (GENERIC) #224: Thu Sep 30 14:13:34 MDT 2021
                         
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC

        Architecture: OpenBSD.amd64
        Machine     : amd64
Description:
        Since I upgraded my routers to 7.0, I am unable to get a DHCP
        lease on CARP interfaces. On 6.9 dhclient worked just fine. On

This fixes it for me in a test setup.

diff --git frontend.c frontend.c
index aecdfd72911..e3fc5b54890 100644
--- frontend.c
+++ frontend.c
@@ -601,8 +601,8 @@ update_iface(struct if_msghdr *ifm, struct sockaddr_dl *sdl)
        ifinfo.running = (flags & (IFF_UP | IFF_RUNNING)) ==
            (IFF_UP | IFF_RUNNING);
- if (sdl != NULL && sdl->sdl_type == IFT_ETHER &&
-           sdl->sdl_alen == ETHER_ADDR_LEN)
+       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) {
@@ -691,7 +691,8 @@ init_ifaces(void)
                                struct sockaddr_dl      *sdl;
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
-                               if (sdl->sdl_type != IFT_ETHER ||
+                               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,



Reply via email to