Fix is_local_ip matching
Add boundaries to the matching to ensure that we don't incompletely match the IP. Closes-Bug: 1590010 Change-Id: I06c1e145fd5e98827d8b092719f11c642b1ecdf1
This commit is contained in:
parent
9e381f509b
commit
cf94c5ebda
@ -18,7 +18,7 @@ function get_metadata_ip() {
|
||||
|
||||
function is_local_ip() {
|
||||
local IP_TO_CHECK=$1
|
||||
if ip a | grep ^\ *inet | grep $IP_TO_CHECK &>/dev/null; then
|
||||
if ip -o a | grep "inet6\? $IP_TO_CHECK/" &>/dev/null; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user