Merge pull request #20570 from pprindeville/isc-dhcp-allow-no-default-route

isc-dhcp: allow no default route
This commit is contained in:
Philip Prindeville 2023-03-04 18:08:07 -07:00 committed by GitHub
commit bf51e33b57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=isc-dhcp PKG_NAME:=isc-dhcp
UPSTREAM_NAME:=dhcp UPSTREAM_NAME:=dhcp
PKG_VERSION:=4.4.3 PKG_VERSION:=4.4.3
PKG_RELEASE:=6 PKG_RELEASE:=7
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE PKG_LICENSE_FILES:=LICENSE

View file

@ -364,7 +364,9 @@ gen_dhcp_subnet() {
echo " default-lease-time $leasetime;" echo " default-lease-time $leasetime;"
echo " max-lease-time $leasetime;" echo " max-lease-time $leasetime;"
fi fi
echo " option routers $gateway;" if [ "$defaultroute" -eq 1 ] ; then
echo " option routers $gateway;"
fi
echo " option domain-name-servers $DNS;" echo " option domain-name-servers $DNS;"
config_list_foreach "$cfg" "routes" append_routes config_list_foreach "$cfg" "routes" append_routes
config_list_foreach "$cfg" "dhcp_option" append_dhcp_options config_list_foreach "$cfg" "dhcp_option" append_dhcp_options
@ -374,7 +376,7 @@ gen_dhcp_subnet() {
dhcpd_add() { dhcpd_add() {
local cfg="$1" synthesize="$2" local cfg="$1" synthesize="$2"
local dhcp6range="::" local dhcp6range="::"
local dynamicdhcp end gateway ifname ignore leasetime limit net netmask local dynamicdhcp defaultroute end gateway ifname ignore leasetime limit net netmask
local proto networkid start subnet local proto networkid start subnet
local IP NETMASK BROADCAST NETWORK PREFIX DNS START END local IP NETMASK BROADCAST NETWORK PREFIX DNS START END
@ -404,6 +406,8 @@ dhcpd_add() {
config_get_bool dynamicdhcp "$cfg" "dynamicdhcp" 1 config_get_bool dynamicdhcp "$cfg" "dynamicdhcp" 1
config_get_bool defaultroute "$cfg" "default_route" 1
dhcp_ifs="$dhcp_ifs $ifname" dhcp_ifs="$dhcp_ifs $ifname"
eval "$(ipcalc.sh $subnet $start $limit)" eval "$(ipcalc.sh $subnet $start $limit)"
@ -512,8 +516,8 @@ update-optimization off;
include "$session_key_file"; include "$session_key_file";
zone $domain. { zone $domain. {
primary 127.0.0.1; primary 127.0.0.1;
key $session_key_name; key $session_key_name;
} }
EOF EOF
@ -522,8 +526,8 @@ EOF
mynet="$(rev_str "$mynet" ".")" mynet="$(rev_str "$mynet" ".")"
cat <<EOF cat <<EOF
zone $mynet.in-addr.arpa. { zone $mynet.in-addr.arpa. {
primary 127.0.0.1; primary 127.0.0.1;
key $session_key_name; key $session_key_name;
} }
EOF EOF