aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-03-13 12:45:13 +0100
committerJo-Philipp Wich <jo@mein.io>2019-12-22 22:52:01 +0100
commit2152722bd3f95878dfdc9071054ceb59e36217bb (patch)
tree9675ddfc29b2b8e23b74bb4a7678fc79c42b9f4f
parentc3337e8f48701fa5070d6224cf7669da054c7098 (diff)
downloadupstream-2152722bd3f95878dfdc9071054ceb59e36217bb.tar.gz
upstream-2152722bd3f95878dfdc9071054ceb59e36217bb.tar.bz2
upstream-2152722bd3f95878dfdc9071054ceb59e36217bb.zip
netifd: add support for suppressing the DHCP request hostname by setting it to *
dnsmasq (and probably other DHCP servers as well) does not like to hand out leases with duplicate host names. Adding support for skipping the hostname makes it easier to deploy setups where it is not guaranteed to be unique Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry picked from commit fd8ca8deb3197a2867d85fc3513f5aa70912ee40)
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/proto/dhcp.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index a2b0ccedbf..0d06eba06e 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -46,6 +46,8 @@ proto_dhcp_setup() {
json_for_each_item proto_dhcp_add_sendopts sendopts dhcpopts
[ -z "$hostname" ] && hostname="$(cat /proc/sys/kernel/hostname)"
+ [ "$hostname" = "*" ] && hostname=
+
[ "$defaultreqopts" = 0 ] && defaultreqopts="-o" || defaultreqopts=
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ "$release" = 1 ] && release="-R" || release=