diff options
author | Felix Fietkau <nbd@nbd.name> | 2019-03-13 12:45:13 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-03-16 19:59:02 +0100 |
commit | fd8ca8deb3197a2867d85fc3513f5aa70912ee40 (patch) | |
tree | f72178347da74fcde970166541adb646247f75c4 /package/network | |
parent | 5cda4a3e309faa314bab6297958db2413eeacdf3 (diff) | |
download | upstream-fd8ca8deb3197a2867d85fc3513f5aa70912ee40.tar.gz upstream-fd8ca8deb3197a2867d85fc3513f5aa70912ee40.tar.bz2 upstream-fd8ca8deb3197a2867d85fc3513f5aa70912ee40.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>
Diffstat (limited to 'package/network')
-rwxr-xr-x | package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 2 |
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= |