diff options
author | Eric Luehrsen <ericluehrsen@gmail.com> | 2019-04-29 22:27:53 -0400 |
---|---|---|
committer | Eric Luehrsen <ericluehrsen@gmail.com> | 2019-04-29 22:34:08 -0400 |
commit | 1077a04b762573bcdbffe603bb547a2e08ee0a01 (patch) | |
tree | 5dd6ae7159dba4008ac6a183df432ace00ea665f /net/unbound/files | |
parent | 57c8837af1f8c1a93788f180f5aeec8c01a361af (diff) |
unbound: fix local dns synthesis corner cases
Signed-off-by: Eric Luehrsen <ericluehrsen@gmail.com>
Diffstat (limited to 'net/unbound/files')
-rw-r--r-- | net/unbound/files/odhcpd.awk | 5 | ||||
-rw-r--r-- | net/unbound/files/unbound.sh | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/net/unbound/files/odhcpd.awk b/net/unbound/files/odhcpd.awk index 85c15c2f2..f8912dfe6 100644 --- a/net/unbound/files/odhcpd.awk +++ b/net/unbound/files/odhcpd.awk @@ -36,10 +36,12 @@ sub( /.*\//, "", cdr ) ; sub( /\/.*/, "", adr2 ) ; sub( /.*\//, "", cdr2 ) ; + gsub( /_/, "-", hst ) ; if ( hst !~ /^[[:alnum:]]([-[:alnum:]]*[[:alnum:]])?$/ ) { # that is not a valid host name (RFC1123) + # above replaced common error of "_" in host name with "-" hst = "-" ; } @@ -48,7 +50,7 @@ # TODO: this might be better with a substituion option, # or per DHCP pool do-not-DNS option, but its getting busy here. fqdn = net - fqdn = sub( /\./, "-", fqdn ) ; + gsub( /\./, "-", fqdn ) ; fqdn = tolower( hst "." fqdn "." domain ) ; } @@ -86,6 +88,7 @@ while ( ( cmd | getline adr ) > 0 ) { if (( substr( adr, 1, 5 ) <= "fdff:" ) \ + && ( index( adr, "::/" ) != 0 ) \ && ( index( adr, "anycast" ) == 0 ) \ && ( index( adr, "via" ) == 0 )) { # GA or ULA routed addresses only (not LL or MC) diff --git a/net/unbound/files/unbound.sh b/net/unbound/files/unbound.sh index 759616136..87b632952 100644 --- a/net/unbound/files/unbound.sh +++ b/net/unbound/files/unbound.sh @@ -112,10 +112,11 @@ bundle_all_networks() { bundle_lan_networks() { local cfg="$1" - local ifsubnet ifname ifdashname ignore + local interface ifsubnet ifname ifdashname ignore config_get_bool ignore "$cfg" ignore 0 - network_get_device ifname "$cfg" + config_get interface "$cfg" interface "" + network_get_device ifname "$interface" ifdashname="${ifname//./-}" |