unbound: drop odhcpd leases with wrong field count
Signed-off-by: Eric Luehrsen <ericluehrsen@gmail.com>
This commit is contained in:
parent
38ced675aa
commit
59617f076d
2 changed files with 59 additions and 58 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=unbound
|
||||
PKG_VERSION:=1.7.3
|
||||
PKG_RELEASE:=5
|
||||
PKG_RELEASE:=6
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
|
|
@ -37,6 +37,12 @@
|
|||
sub( /.*\//, "", cdr2 ) ;
|
||||
|
||||
|
||||
if ( hst !~ /^[[:alnum:]]([-[:alnum:]]*[[:alnum:]])?$/ ) {
|
||||
# that is not a valid host name (RFC1123)
|
||||
hst = "-" ;
|
||||
}
|
||||
|
||||
|
||||
if ( bisolt == 1 ) {
|
||||
# TODO: this might be better with a substituion option,
|
||||
# or per DHCP pool do-not-DNS option, but its getting busy here.
|
||||
|
@ -50,17 +56,9 @@
|
|||
}
|
||||
|
||||
|
||||
if ( cls == "ipv4" ) {
|
||||
if ( NF == 8 ) {
|
||||
# odhcpd errata in field format without host name
|
||||
adr = $8 ; hst = "-" ; cdr = adr ;
|
||||
sub( /\/.*/, "", adr ) ;
|
||||
sub( /.*\//, "", cdr ) ;
|
||||
}
|
||||
|
||||
|
||||
if (( cdr == 32 ) && ( hst != "-" )) {
|
||||
# only for provided hostnames and full /32 assignments
|
||||
if ((cls == "ipv4") && (hst != "-") && (cdr == 32) && (NF == 9)) {
|
||||
# IPV4 ; only for provided hostnames and full /32 assignments
|
||||
# NF=9 ; odhcpd errata in field format without host name
|
||||
ptr = adr ; qpr = "" ; split( ptr, ptr, "." ) ;
|
||||
slaac = slaac_eui64( id ) ;
|
||||
|
||||
|
@ -118,10 +116,9 @@
|
|||
close( cmd ) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
if (( cdr == 128 ) && ( hst != "-" )) {
|
||||
else if ((cls != "ipv4") && (hst != "-") && (9 <= NF) && (NF <= 10)) {
|
||||
if (cdr == 128) {
|
||||
if ( bconf == 1 ) {
|
||||
x = ( "local-data: \"" fqdn ". 300 IN AAAA " adr "\"" ) ;
|
||||
y = ( "local-data-ptr: \"" adr " 300 " fqdn "\"" ) ;
|
||||
|
@ -137,7 +134,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (( cdr2 == 128 ) && ( hst != "-" )) {
|
||||
if (cdr2 == 128) {
|
||||
if ( bconf == 1 ) {
|
||||
x = ( "local-data: \"" fqdn ". 300 IN AAAA " adr2 "\"" ) ;
|
||||
y = ( "local-data-ptr: \"" adr2 " 300 " fqdn "\"" ) ;
|
||||
|
@ -153,6 +150,10 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
# dump non-conforming lease records
|
||||
}
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
|
Loading…
Reference in a new issue