summaryrefslogtreecommitdiff
path: root/src/system
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-02-21 19:13:59 +0100
committerChristian Poessinger <christian@poessinger.com>2019-02-25 18:20:05 +0100
commite81a1e82f1b3305fca81c79629b8a705ccc79573 (patch)
tree538e377505514760ba6a9faac598960d4a6a82ec /src/system
parent2f67ed3a142f74be43b0fd7e6cf8e7717b2c1b06 (diff)
downloadvyos-1x-e81a1e82f1b3305fca81c79629b8a705ccc79573.tar.gz
vyos-1x-e81a1e82f1b3305fca81c79629b8a705ccc79573.zip
[dhcp] T1211: avoid blank DHCP hostnames taking down DNS
(cherry picked from commit 944a665cfc19cca1af9d46a70fb31ba1f4893d68)
Diffstat (limited to 'src/system')
-rwxr-xr-xsrc/system/on-dhcp-event.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/system/on-dhcp-event.sh b/src/system/on-dhcp-event.sh
index d671bffd6..02bbd4c3c 100755
--- a/src/system/on-dhcp-event.sh
+++ b/src/system/on-dhcp-event.sh
@@ -22,6 +22,11 @@ domain=$5
file=/etc/hosts
changes=0
+if [ -z "$client_name" ]; then
+ logger -s -t on-dhcp-event "Client name was empty, using MAC \"$client_mac\" instead"
+ client_name=$(echo "client-"$client_mac | tr : -)
+fi
+
if [ "$domain" == "..YYZ!" ]; then
client_fqdn_name=$client_name
client_search_expr=$client_name