mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
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 commitfd4e14b885) (cherry picked from commit8cb09b2953)
This commit is contained in:
parent
0fdfe230a8
commit
ff4034ed4d
@ -699,7 +699,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";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user