From 7617ac208596665061453dfa04b75e4cc8a76ac9 Mon Sep 17 00:00:00 2001 From: Jens Harbott Date: Tue, 19 Sep 2017 17:43:48 +0000 Subject: [PATCH] Make is_ipv4_address a bit more robust Still not ideal, but at least should avoid matching IPv6 addresses. Change-Id: Ibb64263fdb0308f56c18518289501dd4642dcbad --- functions-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-common b/functions-common index 713d92e717..ffdacef32e 100644 --- a/functions-common +++ b/functions-common @@ -2014,7 +2014,7 @@ function cidr2netmask { # Check if this is a valid ipv4 address string function is_ipv4_address { local address=$1 - local regex='([0-9]{1,3}.){3}[0-9]{1,3}' + local regex='([0-9]{1,3}\.){3}[0-9]{1,3}' # TODO(clarkb) make this more robust if [[ "$address" =~ $regex ]] ; then return 0