Project

General

Profile

Bug #3716

Adding IPv6 alias to IPv6 CARP IP throws error - fix proposal attached

Added by Marc Posch over 5 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
Normal
Category:
Virtual IP Addresses
Target version:
Start date:
06/22/2014
Due date:
% Done:

100%

Estimated time:
Affected Version:
All
Affected Architecture:

Description

Hi,

Adding an IPv6 alias to an IPv6 CARP IP throws the following error:
"...Could not find a matching real interface subnet for the virtual IP..."

In my case, I tried adding the IP alias 2001:xxxx:xxxx:128::1 to the already created CARP IP fdfd:3f23:25b0:128::1.
The cluster node interfaces were already configured as follows:

Node 1:
main IPv6: fdfd:3f23:25b0:128::101
IPv6 alias: 2001:xxxx:xxxx:128::101

Node 2:
main IPv6: fdfd:3f23:25b0:128::102
IPv6 alias: 2001:xxxx:xxxx:128::102

I debugged the code so far until I reached the function convert_real_interface_to_friendly_interface_name in interfaces.inc, which was returning an error message instead of an empty string for each interface not configured with an IPv6 address. This was interpreted by the calling code as "true", so the wrong underlying interface was returned, which - as the error message correctly stated - did not have a matching subnet address.

I fixed it by adding an additional line to check, if the underlying interface has valid IPv6 address => worked for me!
I also added this additional check for IPv4 some lines above so anybody who might want to configure a cluster which has some IPv6-only interfaces would not run into the same problem just the other way around.

I would be happy if my fix proposal is helpful and would be included in some way in the next update release.

My version is 2.1.3-RELEASE (i386).

Regards,
Marc

interfaces.inc.patch (909 Bytes) interfaces.inc.patch Marc Posch, 06/22/2014 04:36 PM

Associated revisions

Revision 2a5960b0 (diff)
Added by Luiz Souza almost 4 years ago

Review of CARP uniqid changes.

It turns out that current CARP implementation is not much different from an IP alias.

This commit converts the IP alias to also use the CARP uniqid scheme, this simplify the code in all other places because now we have only two different cases to deal with:

- A friendly interface name (lan, wan, opt1, etc.);
- A Virtual IP - VIP alias (_vip{$uniqid}) - CARP or IP Alias.

The parent of a CARP is always a friendly interface. The parent of an IP alias can be a friendly interface or a CARP (this is the only case of recursion of a VIP).

This commit removes a few cases where CARP were still considered a interface (the old CARP implementation), fixes all the wrong cases of strpos() being used to detect a VIP address (wont work as it returns '0' which fails when tested as 'TRUE'), review the usage of CARP and IP alias as services bind addresses, fixes general issues of adding and editing VIP addresses.

The following subsystems were affected by this changes:

- IPSEC;
- OpenVPN;
- dnsmasq;
- NTP;
- gateways and gateway groups;
- IPv6 RA;
- GRE interfaces;
- CARP status;
- Referrer authentication.

Fixes (and/or revisit) the following tickets:

- Ticket #3257
- Ticket #3716
- Ticket #4450
- Ticket #4858
- Ticket #5441
- Ticket #5442
- Ticket #5500
- Ticket #5783
- Ticket #5844

History

#1 Updated by Phillip Davis over 5 years ago

It will be easy for the devs to review this if you go to github - https://github.com/pfsense/pfsense - and make the changes and submit a pull request. If you have not already done so, you will need to sign a contributor license agreement - https://www.pfsense.org/ESF_Individual_Contributor_License_Agreement_v1.0.pdf - to keep the legal status of your contribution/s sorted.

#2 Updated by Chris Buechler about 4 years ago

  • Category set to Virtual IP Addresses

#3 Updated by Jim Thompson almost 4 years ago

  • Assignee set to Luiz Souza
  • Target version set to 2.3

#4 Updated by Luiz Souza almost 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Fixed in 2.3. Thanks!

#5 Updated by Chris Buechler almost 4 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Luiz Souza to Chris Buechler
  • Affected Version changed from 2.2 to All

to me to confirm

#6 Updated by Chris Buechler almost 4 years ago

  • Status changed from Feedback to Resolved

works

Also available in: Atom PDF