bind: start up with -4 if not listening on ipv6 addresses
authorPhilip Prindeville <philipp@redfish-solutions.com>
Wed, 28 Dec 2022 00:54:16 +0000 (17:54 -0700)
committerNoah Meyerhans <frodo@morgul.net>
Mon, 2 Jan 2023 22:15:57 +0000 (14:15 -0800)
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
net/bind/Makefile
net/bind/files/named.init

index e53a7e7f8b94b99ba58d56c2e8766064406ca47c..699f93550255afdb346721cf4b5ff51056e30118 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bind
 PKG_VERSION:=9.18.10
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 USERID:=bind=57:bind=57
 
 PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
index 7c61b5e2a89f60cbf1039e56866e90d6974ffbd1..312e297fb4b8ff1112d185742bf2c3c830afb3e8 100644 (file)
@@ -30,6 +30,10 @@ fix_perms() {
     done
 }
 
+no_ipv6() {
+    [ -z "$(ip -6 -o route show default)" ]
+}
+
 reload_service() {
     rndc -q reload
 }
@@ -68,8 +72,11 @@ start_service() {
 
     touch $conf_local_file
 
+    local args=
+    [ no_ipv6 ] && args="-4"
+
     procd_open_instance
-    procd_set_param command /usr/sbin/named -u bind -f -c $config_file
+    procd_set_param command /usr/sbin/named -u bind -f $args -c $config_file
     procd_set_param file $config_file \
                         $config_dir/bind.keys \
                         $named_options_file \