From 93420826abe1ddfbbab2c9afe85e111a6af4574d Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Sun, 7 Jan 2018 10:44:19 -0500 Subject: [PATCH] dhcrelay4: add support for up/downstream interfaces dhcrelay has the ability to monitor interfaces for requests in a single direction only rather than listening to all interfaces for requests. Doing this allows one to suppress the duplication of having the relay forward requests from the same network that the DHCP server is on. Signed-off-by: Brian J. Murrell --- net/isc-dhcp/Makefile | 2 +- net/isc-dhcp/files/dhcrelay.conf | 2 ++ net/isc-dhcp/files/dhcrelay4.init | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile index ed4ca7052..63087d3e1 100644 --- a/net/isc-dhcp/Makefile +++ b/net/isc-dhcp/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=isc-dhcp UPSTREAM_NAME:=dhcp PKG_VERSION:=4.4.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE diff --git a/net/isc-dhcp/files/dhcrelay.conf b/net/isc-dhcp/files/dhcrelay.conf index b3b53b516..8d3ddfe1c 100644 --- a/net/isc-dhcp/files/dhcrelay.conf +++ b/net/isc-dhcp/files/dhcrelay.conf @@ -7,6 +7,8 @@ config dhcrelay ipv4 # network interfaces to listen on (e.g. lan or wan) option 'interfaces' '' + option 'upstream_interfaces' '' + option 'downstream_interfaces' '' # What to do about packets that already have a relay option: # 'append': Forward and append our own relay option diff --git a/net/isc-dhcp/files/dhcrelay4.init b/net/isc-dhcp/files/dhcrelay4.init index 64d82281e..0f401a5ca 100644 --- a/net/isc-dhcp/files/dhcrelay4.init +++ b/net/isc-dhcp/files/dhcrelay4.init @@ -25,6 +25,18 @@ start() { append args "-i $ifname" fi done + config_get interfaces ipv4 upstream_interfaces + for net in $interfaces; do + if network_get_device ifname "$net"; then + append args "-iu $ifname" + fi + done + config_get interfaces ipv4 downstream_interfaces + for net in $interfaces; do + if network_get_device ifname "$net"; then + append args "-id $ifname" + fi + done # link selection sub-option (RFC3527) local link_selection