Revision ff4034ed
Added by Jim Pingle about 8 years ago
src/etc/inc/pfsense-utils.inc | ||
---|---|---|
699 | 699 |
|
700 | 700 |
$vhid = $vip['vhid']; |
701 | 701 |
$carp_query = ''; |
702 |
$_gb = exec("/sbin/ifconfig $interface | /usr/bin/grep carp: | /usr/bin/grep \"vhid $vhid\"", $carp_query);
|
|
702 |
$_gb = exec("/sbin/ifconfig {$interface} | /usr/bin/grep \"carp:.* vhid {$vhid} \"", $carp_query);
|
|
703 | 703 |
foreach ($carp_query as $int) { |
704 | 704 |
if (stripos($int, "MASTER")) |
705 | 705 |
return "MASTER"; |
Also available in: Unified diff
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.
(cherry picked from commit fd4e14b8853e7a30ee23532d686270cb40d84d03)
(cherry picked from commit 8cb09b295385faf4a3cd0af6e261cdf6f45b3d36)