From: florian Date: Wed, 20 Oct 2021 07:04:49 +0000 (+0000) Subject: Do not ignore carp(4) interfaces. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a13fc78def9089c3ea9e5165fd8ed7c01f07de3f;p=openbsd Do not ignore carp(4) interfaces. Problem reported by Guy Godfroy on bugs, thanks! --- diff --git a/sbin/dhcpleased/frontend.c b/sbin/dhcpleased/frontend.c index aecdfd72911..5131dce1471 100644 --- a/sbin/dhcpleased/frontend.c +++ b/sbin/dhcpleased/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.22 2021/09/14 07:51:51 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.23 2021/10/20 07:04:49 florian Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -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,