commit 11d381874a35ef1e6c970c722b1d610abef71698 from: florian date: Tue Jul 02 17:41:27 2024 UTC Use correct idiom to get mac addresses from ethernet-like interfaces. This unbreaks rad(8) on top of carp(4). OK deraadt, bluhm commit - 1c92b4e7947b20ad601c7119861ff9e6bb5a8d35 commit + 11d381874a35ef1e6c970c722b1d610abef71698 blob - e0beb3352954c189312db206d9ef70032d05ef51 blob + c700c079e6d799f89c8c133dfb54521626cc09fc --- usr.sbin/rad/frontend.c +++ usr.sbin/rad/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.48 2024/05/31 16:10:42 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.49 2024/07/02 17:41:27 florian Exp $ */ /* * Copyright (c) 2018 Florian Obser @@ -777,8 +777,9 @@ merge_ra_interface(char *if_name, char *conf_name, str link_state = ((struct if_data*)ifa->ifa_data)->ifi_link_state; sdl = (struct sockaddr_dl *)ifa->ifa_addr; - if (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) { has_hw_addr = 1; memcpy(&hw_addr, LLADDR(sdl), ETHER_ADDR_LEN); }