Bug#1071447: iproute2: IPv6 route in VRF context fails with 'Invalid source address' due to default VRF check.

2024-05-19 Thread Luca Boccassi
Control: tags -1 upstream

On Sun, 19 May 2024 15:39:05 +0200 Tharyrok  wrote:
> Package: iproute2
> X-Debbugs-Cc: d...@tharyrok.eu
> Version: 6.9.0-1
> Severity: normal
> Tags: ipv6
> 
> Dear Maintainer,
> 
> I am encountering an issue when adding an IPv6 route within a VRF 
> context on Debian using ifupdown2. The problem occurs when I attempt
to 
> add an unreachable default route with a specific source address. I 
> receive an "Invalid source address" error. However, this issue does
not 
> occur with IPv4 routes under similar conditions.

Please report this upstream, there are no patches in Debian so the
behaviour is just what upstream provides.

-- 
Kind regards,
Luca Boccassi


signature.asc
Description: This is a digitally signed message part


Bug#1071447: iproute2: IPv6 route in VRF context fails with 'Invalid source address' due to default VRF check.

2024-05-19 Thread Tharyrok

Package: iproute2
X-Debbugs-Cc: d...@tharyrok.eu
Version: 6.9.0-1
Severity: normal
Tags: ipv6

Dear Maintainer,

I am encountering an issue when adding an IPv6 route within a VRF 
context on Debian using ifupdown2. The problem occurs when I attempt to 
add an unreachable default route with a specific source address. I 
receive an "Invalid source address" error. However, this issue does not 
occur with IPv4 routes under similar conditions.


/etc/network/interfaces Configuration:
auto routing
iface routing
     address 127.0.0.1/8
     address ::1/128
     vrf-table 1011

auto dummy0
iface dummy0
     link-type dummy
     pre-up /usr/sbin/ip link add dummy0 type dummy
     post-down /usr/sbin/ip link del dummy0 type dummy
     address 169.254.0.10/32
     address fd6c:3502:f677::10/128
     vrf routing

Steps to Reproduce:
1. Add the IPv6 route in the VRF context: ip -6 route add unreachable 
default src fd6c:3502:f677::10 vrf routing

    Result: Error: Invalid source address.

2. Add the IPv4 route in the VRF context: ip route add unreachable 
default src 169.254.0.10 vrf routing

    Result: No error, and the routing table is updated correctly:

    # ip route show vrf routing
    unreachable default src 169.254.0.10
    127.0.0.0/8 dev routing proto kernel scope link src 127.0.0.1

3. Adding another dummy interface not in the VRF context:
    auto dummy1
    iface dummy1
    link-type dummy
    pre-up /usr/sbin/ip link add dummy1 type dummy
    post-down /usr/sbin/ip link del dummy1 type dummy
    address fd6c:3502:f677::10/128

4. Retry adding the IPv6 route in the VRF context: ip -6 route add 
unreachable default src fd6c:3502:f677::10 vrf routing

    Result: No error, and the routing table is updated correctly:

    # ip -6 route show vrf routing
    ::1 dev routing proto kernel metric 256 pref medium
    fd6c:3502:f677::10 dev dummy0 proto kernel metric 256 pref medium
    fe80::/64 dev dummy0 proto kernel metric 256 pref medium
    multicast ff00::/8 dev dummy0 proto kernel metric 256 pref medium
    unreachable default dev lo src fd6c:3502:f677::10 metric 1024 pref 
medium


The issue seems to be related to the source address check being 
performed in the default VRF context instead of the specified VRF 
context when adding an IPv6 route. This behavior is inconsistent with 
the IPv4 routing behavior in a VRF context.


Please let me know if further information is required or if there are 
any patches or tests I can perform to assist in resolving this issue.


Best regards,
Tharyrok

-- System Information:
Debian Release: trixie/sid
   APT prefers unstable
   APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.8.9-cloud-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages iproute2 depends on:
ii  debconf [debconf-2.0]  1.5.86
ii  libbpf1    1:1.4.1-1
ii  libc6  2.38-11
ii  libcap2    1:2.66-5
ii  libcap2-bin    1:2.66-5
ii  libdb5.3t64    5.3.28+dfsg2-7
ii  libelf1t64 0.191-1+b1
ii  libmnl0    1.0.5-2+b1
ii  libselinux1    3.5-2+b2
ii  libtirpc3t64   1.3.4+ds-1.3
ii  libxtables12   1.8.10-3

iproute2 recommends no packages.

Versions of packages iproute2 suggests:
ii  python3  3.11.8-1

-- debconf information:
   iproute2/setcaps: false


OpenPGP_0xE3739989CBBA86C4.asc
Description: OpenPGP public key