diff options
author | jim-p <jimp@pfsense.org> | 2017-06-20 10:48:44 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2017-06-20 10:48:44 -0400 |
commit | fd4e14b8853e7a30ee23532d686270cb40d84d03 (patch) | |
tree | b647d8037896bac6b61a9cfe5f17ae24b6169f58 /src/etc/inc/pfsense-utils.inc | |
parent | 07ef7e797909ffd816f961cbb0735d4198896dc8 (diff) | |
download | pfsense-fd4e14b8853e7a30ee23532d686270cb40d84d03.zip pfsense-fd4e14b8853e7a30ee23532d686270cb40d84d03.tar.gz |
Match whitespace after $vhid when checking CARP status to avoid partial matches. Fixes #7638
While here, fix variable references with braces and combine the two calls to grep into a single pattern.
Diffstat (limited to 'src/etc/inc/pfsense-utils.inc')
-rw-r--r-- | src/etc/inc/pfsense-utils.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index d3d5435..c0a083b 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -725,7 +725,7 @@ function get_carp_interface_status($carpid) { $vhid = $vip['vhid']; $carp_query = ''; - $_gb = exec("/sbin/ifconfig $interface | /usr/bin/grep carp: | /usr/bin/grep \"vhid $vhid\"", $carp_query); + $_gb = exec("/sbin/ifconfig {$interface} | /usr/bin/grep \"carp:.* vhid {$vhid} \"", $carp_query); foreach ($carp_query as $int) { if (stripos($int, "MASTER")) return "MASTER"; |