Bug 207063 - vrf route oif problem
Summary: vrf route oif problem
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-02 14:15 UTC by Ma Shaohua
Modified: 2020-04-09 16:25 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.5.11
Subsystem:
Regression: No
Bisected commit-id:


Attachments
vrf route oif problem (708 bytes, text/plain)
2020-04-02 14:15 UTC, Ma Shaohua
Details

Description Ma Shaohua 2020-04-02 14:15:58 UTC
Created attachment 288155 [details]
vrf route oif problem

first create vrf
#ip link add vrf-1 type vrf table 10
#ip link set dev vrf-1 up

then add default route and set local table
#ip route add table 10 unreachable default metric 4278198272
#ip rule add pref 32765 table local
#ip rule del pref 0

set slave interfaces
#ip link set dev ens19 master vrf-1
#ip link set dev ens20 master vrf-1

and then add ip
#ip a a 2.2.2.2/24 dev ens19
#ip a a 3.3.3.3/24 dev ens20

add default route
#ip route add default via 2.2.2.2 dev ens19 table 10 metric 300
#ip route add default via 3.3.3.3 dev ens20 table 10 metric 301

use command to test the route
#ip r g 5.5.5.5 oif ens20

but the result is 2.2.2.2 not 3.3.3.3
don't match the oif!!

I try with kernel vesion 5.5.11
Comment 1 David Ahern 2020-04-02 15:56:18 UTC
Known limitation with the VRF implementation. I have ideas on how to fix it, but it will not happen any time soon.
Comment 2 Ma Shaohua 2020-04-06 12:10:17 UTC
(In reply to David Ahern from comment #1)
> Known limitation with the VRF implementation. I have ideas on how to fix it,
> but it will not happen any time soon.
when do you plan to fix it? I want to fix this problem in my project, do fixing this problem modify much code? I read some kernel code about vrf and route, found that slaved interface is replaced by the master interface and set the flag FLOWI_FLAG_SKIP_NH_OIF, is this right? Could you tell me more specific time to solve this problem? And maybe I can fix this problem simplely in my project, and when you solve it then I merge your commit. And if I have some problem, can I ask you for some help? Thank you very much!!
Comment 3 David Ahern 2020-04-09 16:25:15 UTC
yes, that is correct. The switch needs to be removed.

Note You need to log in before you can comment on or make changes to this bug.