Bug #7638
closedCarp Status incorrect - visual bug in webconfigurator interface
100%
Description
There is a bug where if certain high VHID numbers are added before lower numbers, the status on the Status -> CARP (failover) page will show as incorrect for certain vhids due to pattern matching error.
The issue can be reproduced by the following:
Add CARP IP with VHID = 10
Add CARP IP with VHID = 1
Set CARP IP with VHID = 10 to be MASTER. Both CARP IPs will show as MASTER in Status page.
Issue arises because of the a pattern match on the following output of ifconfig:
carp: MASTER vhid 10 advbase 1 advskew 0
carp: BACKUP vhid 1 advbase 1 advskew 150
The following line in pfsense-utils.inc (get_carp_interface_status function) is responsible:
$_gb = exec("/sbin/ifconfig $interface | /usr/bin/grep carp: | /usr/bin/grep \"vhid $vhid\"", $carp_query);
Pattern matching of the grep statement needs to include the termination white space character after the $vhid variable to ensure that the pattern "vhid 1" doesn't match on "vhid 10" in the first line.
Changing this line to the following fixes the error:
$_gb = exec("/sbin/ifconfig $interface | /usr/bin/grep carp: | /usr/bin/grep \"vhid $vhid \"", $carp_query);
Updated by Chris Linstruth over 7 years ago
Looks like this is the case.
Updated by Jim Pingle over 7 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset fd4e14b8853e7a30ee23532d686270cb40d84d03.
Updated by Jim Pingle over 7 years ago
- Category set to CARP
- Assignee set to Jim Pingle
- Target version set to 2.3.4-p1
- Affected Version set to All
- Affected Architecture All added
- Affected Architecture deleted (
)