Переглянути джерело

ddns-scripts: fix ticket #17998: wrongly detect ipv4 start with 10x.x.x.x

Thanks to "eqsun" for report and offer of fix.
Otherwise the ip address starts with 100~109 will be treated as invalid.
Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
Christian Schoenebeck 10 роки тому
джерело
коміт
c26946e487

+ 1
- 1
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh Переглянути файл

@@ -553,7 +553,7 @@ send_update() {
553 553
 	local __IP __URL __ANSWER __ERR
554 554
 
555 555
 	# verify given IP
556
-	[ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10|^127|^172|^192)")	# no private IPv4's
556
+	[ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172|^192)")	# no private IPv4's
557 557
 	[ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]")	# no IPv6 addr starting with fxxx of with ":"
558 558
 	[ -z "$__IP" ] && critical_error "Invalid or no IP '$1' given"
559 559