ddns-scripts: fix ticket #17998: wrongly detect ipv4 start with 10x.x.x.x
authorChristian Schoenebeck <redacted>
Mon, 29 Sep 2014 18:29:46 +0000 (20:29 +0200)
committerChristian Schoenebeck <redacted>
Mon, 29 Sep 2014 18:29:46 +0000 (20:29 +0200)
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 <redacted>
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh

index 63e49bd820781fc6c973339e57b798945631ea0f..778735beaa6fb438a908f6ec3cbe01c2ff3c7cda 100644 (file)
@@ -553,7 +553,7 @@ send_update() {
        local __IP __URL __ANSWER __ERR
 
        # verify given IP
-       [ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10|^127|^172|^192)")   # no private IPv4's
+       [ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172|^192)") # no private IPv4's
        [ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]")    # no IPv6 addr starting with fxxx of with ":"
        [ -z "$__IP" ] && critical_error "Invalid or no IP '$1' given"
 
git clone https://git.99rst.org/PROJECT