Project

General

Profile

Actions

Bug #7638

closed

Carp Status incorrect - visual bug in webconfigurator interface

Added by Steven Brown almost 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
CARP
Target version:
Start date:
06/11/2017
Due date:
% Done:

100%

Estimated time:
0.10 h
Plus Target Version:
Release Notes:
Affected Version:
All
Affected Architecture:
All

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);

Actions #1

Updated by Chris Linstruth almost 7 years ago

Actions #2

Updated by Jim Pingle almost 7 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #3

Updated by Jim Pingle almost 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 ()
Actions #4

Updated by Jim Pingle almost 7 years ago

  • Status changed from Feedback to Resolved

Fixed

Actions

Also available in: Atom PDF