From 8d53af64efe8ae38d31054229b40d8cf8d6b456b Mon Sep 17 00:00:00 2001 From: reyk Date: Fri, 7 Jul 2017 17:25:09 +0000 Subject: [PATCH] Handle carp(4) as HTYPE_ETHER. This fixes "dhcrelay -i carpX" that used to work when dhcrelay didn't care. Reported and tested by Kapetanakis Giannis bilias at edu.physics.uoc.gr --- usr.sbin/dhcrelay/dispatch.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.sbin/dhcrelay/dispatch.c b/usr.sbin/dhcrelay/dispatch.c index d6fece8ad02..920123108ae 100644 --- a/usr.sbin/dhcrelay/dispatch.c +++ b/usr.sbin/dhcrelay/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.21 2017/04/04 15:52:12 reyk Exp $ */ +/* $OpenBSD: dispatch.c,v 1.22 2017/07/07 17:25:09 reyk Exp $ */ /* * Copyright 2004 Henning Brauer @@ -137,18 +137,19 @@ setup_iflist(void) sdl = (struct sockaddr_dl *)ifa->ifa_addr; ifi = (struct if_data *)ifa->ifa_data; - /* Skip non ethernet interfaces. */ + /* Skip unsupported interfaces. */ if (ifi->ifi_type != IFT_ETHER && - ifi->ifi_type != IFT_ENC) { + ifi->ifi_type != IFT_ENC && + ifi->ifi_type != IFT_CARP) { TAILQ_REMOVE(&intflist, intf, entry); free(intf); continue; } - if (ifi->ifi_type == IFT_ETHER) - intf->hw_address.htype = HTYPE_ETHER; - else + if (ifi->ifi_type == IFT_ENC) intf->hw_address.htype = HTYPE_IPSEC_TUNNEL; + else + intf->hw_address.htype = HTYPE_ETHER; intf->index = sdl->sdl_index; intf->hw_address.hlen = sdl->sdl_alen; -- 2.20.1