summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcrelay
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2017-07-07 17:25:09 +0000
committerreyk <reyk@openbsd.org>2017-07-07 17:25:09 +0000
commit8d53af64efe8ae38d31054229b40d8cf8d6b456b (patch)
treef91ba8da503bf0eb3a08098d91db6de26930c6e0 /usr.sbin/dhcrelay
parentsimplify the eqn_box_makebinary() function by removing the trivial pos (diff)
downloadwireguard-openbsd-8d53af64efe8ae38d31054229b40d8cf8d6b456b.tar.xz
wireguard-openbsd-8d53af64efe8ae38d31054229b40d8cf8d6b456b.zip
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
Diffstat (limited to 'usr.sbin/dhcrelay')
-rw-r--r--usr.sbin/dhcrelay/dispatch.c13
1 files 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 <henning@openbsd.org>
@@ -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;