Project

General

Profile

Actions

Bug #12282

closed

Default IPv4 gateway may be set to IPv6 gateway value in certain cases

Added by Viktor Gurov over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Viktor Gurov
Category:
Gateways
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
22.01
Release Notes:
Default
Affected Version:
2.5.2
Affected Architecture:

Description

setdefaultgateway() may set IPv6 gateway as a IPv4 gateway in some cases,
see https://github.com/pfsense/pfsense/blob/master/src/etc/inc/gwlb.inc#L1209-L1220:

    if ($currentdefaultgwip != $gw['gateway']) {
        log_error("Default gateway setting {$gw['descr']} as default.");

        if ($ipprotocol == 'inet') {
            array_map('unlink', glob("{$g['tmp_path']}/*_defaultgw", GLOB_BRACE));
        } else {
            array_map('unlink', glob("{$g['tmp_path']}/*_defaultgwv6", GLOB_BRACE));
        }
        $defaultif = get_real_interface($gw['interface']);
        if ($defaultif) {
            @file_put_contents("{$g['tmp_path']}/{$defaultif}_defaultgw", $gw['gateway']);
        }

-- it always puts the new default gateway value (no matter of protocol family) to {$defaultif}_defaultgw

Actions

Also available in: Atom PDF