Skip to content

Commit 7617ac2

Browse files
committed
Make is_ipv4_address a bit more robust
Still not ideal, but at least should avoid matching IPv6 addresses. Change-Id: Ibb64263fdb0308f56c18518289501dd4642dcbad
1 parent b2330c8 commit 7617ac2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

functions-common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ function cidr2netmask {
20142014
# Check if this is a valid ipv4 address string
20152015
function is_ipv4_address {
20162016
local address=$1
2017-
local regex='([0-9]{1,3}.){3}[0-9]{1,3}'
2017+
local regex='([0-9]{1,3}\.){3}[0-9]{1,3}'
20182018
# TODO(clarkb) make this more robust
20192019
if [[ "$address" =~ $regex ]] ; then
20202020
return 0

0 commit comments

Comments
 (0)