Project

General

Profile

Actions

Regression #14623

closed

Primary interface address is incorrectly set to the last address on the interface

Added by Ajay Easter over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Interfaces
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.09
Release Notes:
Default
Affected Version:
2.7.x
Affected Architecture:
All

Description

The fixes for #11545 seem to have introduced another regresssion when finding the primary interface address.

My WAN interface gets both a GUA and a ULA address from the upstream router. In pfSense 2.6.0 the primary interface address shown in the UI would correctly be the GUA. In pfSense 2.7.0 it now always uses the ULA as the primary interface address, breaking things like IPsec. My site-to-site tunnels would only come up again after I had manually removed the ULA from the interface.

I traced the problem to the new get_interface_addresses function. It always returns the last IPv6 address it found for an interface (excluding VIPs). I am not sure by which logic FreeBSD sorts IP addresses, but in my case the GUA is always listed first. Maybe it's just the same order the addresses were specified in the Router Advertisement.

In any case pfSense's previous behaviour should be restored, which is to use the first address returned by the OS as the primary address rather than the last. pfSense_get_interface_addresses, which was deprecated by get_interface_addresses, still does exactly that. In 2.7.0 it still correctly returns the GUA while at the same time get_interface_addresses returns the ULA.

Fixing this should be as easy replacing array_pop with array_shift.


Related issues

Related to Bug #14725: Primary IPv6 interface address may be incorrect when a ULA is setResolvedMarcos M

Actions
Related to Bug #14785: Primary IPv6 interface address may be incorrect when a VIP is setResolvedMarcos M

Actions
Has duplicate Bug #14782: RFC 2136 Dynamic DNS client selects a virtual IPv6 address instead of statically configured WAN Ipv6 addressDuplicate

Actions
Actions

Also available in: Atom PDF