Bug#922686: iproute2: ip route get ipv6 returns lo when forwarding is enabled

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#922686: iproute2: ip route get ipv6 returns lo when forwarding is enabled

Mike Massonnet-4
Package: iproute2
Version: 4.9.0-1+deb9u1
Severity: normal
Tags: ipv6


I stepped on a bug that is triggered when enabling ipv6 forwarding.

Whenever I request the route for my subnet, with ipv6 forwarding
enabled, it responds with the looopback.

For example a server with IPv6 1234:1234:1:2::40/64 on eth0.

When I run the commands:
`ip route get 1234:1234:1:2::/64`
`ip route get 1234:1234:1:2::0`

I get the route with the right interface:

```
# sysctl net.ipv6.conf.all.forwarding
net.ipv6.conf.all.forwarding = 0

# ip route get 1234:1234:1:2::/64
1234:1234:1:2:: from :: dev eth0 proto kernel src 1234:1234:1:2::40
metric 256  pref medium ```

But as soon as I enable forwarding it returns a bad value:

```
# sysctl net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.forwarding = 1

# ip route get 1234:1234:1:2::/64
local 1234:1234:1:2:: from :: dev lo table local proto none src
1234:1234:1:2::40 metric 0  pref medium ```

I can "cheat" around, for example by requesting the route for
1234:1234:1:2::1/64 it will return the expected route.

Regards,
Mike

Reply | Threaded
Open this post in threaded view
|

Bug#922686: iproute2: ip route get ipv6 returns lo when forwarding is enabled

Luca Boccassi-3
On Tue, 2019-02-19 at 13:42 +0100, Mike Massonnet wrote:

> Package: iproute2
> Version: 4.9.0-1+deb9u1
> Severity: normal
> Tags: ipv6
>
>
> I stepped on a bug that is triggered when enabling ipv6 forwarding.
>
> Whenever I request the route for my subnet, with ipv6 forwarding
> enabled, it responds with the looopback.
>
> For example a server with IPv6 1234:1234:1:2::40/64 on eth0.
>
> When I run the commands:
> `ip route get 1234:1234:1:2::/64`
> `ip route get 1234:1234:1:2::0`
>
> I get the route with the right interface:
>
> ```
> # sysctl net.ipv6.conf.all.forwarding
> net.ipv6.conf.all.forwarding = 0
>
> # ip route get 1234:1234:1:2::/64
> 1234:1234:1:2:: from :: dev eth0 proto kernel src 1234:1234:1:2::40
> metric 256  pref medium ```
>
> But as soon as I enable forwarding it returns a bad value:
>
> ```
> # sysctl net.ipv6.conf.all.forwarding=1
> net.ipv6.conf.all.forwarding = 1
>
> # ip route get 1234:1234:1:2::/64
> local 1234:1234:1:2:: from :: dev lo table local proto none src
> 1234:1234:1:2::40 metric 0  pref medium ```
>
> I can "cheat" around, for example by requesting the route for
> 1234:1234:1:2::1/64 it will return the expected route.
>
> Regards,
> Mike
Hi,

I can't reproduce this:

$ sudo sysctl -w net.ipv6.conf.all.forwarding=1
net.ipv6.conf.all.forwarding = 1
$ ip route get 1234:1234:1:2::/64
1234:1234:1:2:: from :: via fe80::<foo> dev eth0 proto static src <foobar> metric 100  pref medium
$ ip route get 1234:1234:1:2::1/64
1234:1234:1:2::1 from :: via fe80::<foo> dev eth0 proto static src <foobar> metric 100  pref medium

This is just my desktop with one interface and ipv6 configure via dhcp.

--
Kind regards,
Luca Boccassi

signature.asc (499 bytes) Download Attachment