Bläddra i källkod

Merge pull request #383 from chris5560/master

ddns-scripts: send_update() detection private IPv4
sbyx 10 år sedan
förälder
incheckning
f64c545876

+ 1
- 1
net/ddns-scripts/Makefile Visa fil

@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
2 2
 
3 3
 PKG_NAME:=ddns-scripts
4 4
 PKG_VERSION:=2.0.1
5
-PKG_RELEASE:=4
5
+PKG_RELEASE:=5
6 6
 PKG_LICENSE:=GPL-2.0
7 7
 
8 8
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

+ 3
- 3
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh Visa fil

@@ -552,9 +552,9 @@ send_update() {
552 552
 	# $1	# IP to set at DDNS service provider
553 553
 	local __IP __URL __ANSWER __ERR
554 554
 
555
-	# verify given IP
556
-	[ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172|^192)")	# no private IPv4's
557
-	[ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]")	# no IPv6 addr starting with fxxx of with ":"
555
+	# verify given IP / no private IPv4's / no IPv6 addr starting with fxxx of with ":"
556
+	[ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-1]\.|^192\.168)")
557
+	[ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]")
558 558
 	[ -z "$__IP" ] && critical_error "Invalid or no IP '$1' given"
559 559
 
560 560
 	# do replaces in URL