Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: linux route metric #1826

Merged
merged 1 commit into from
Dec 8, 2021
Merged

fix: linux route metric #1826

merged 1 commit into from
Dec 8, 2021

Conversation

VladoLavor
Copy link
Collaborator

  • the metric change causes the linux route to recreate instead of replacing
    (which led to the creation of a new route instead)
  • for IPv6, the metric 0 and 1024 is considered equal (based on how Linux
    treats it)

Signed-off-by: Vladimir Lavor vlavor@cisco.com

@mhalaj1
Copy link
Collaborator

mhalaj1 commented Nov 30, 2021

When examining this example, I found a bug (unrelated to this PR): VPP agent can not configure IPv6 route with scope set to LINK.
How to reproduce the bug:
Make a copy of the resync method and name it resync2. In the copied method, replace the lines

LinuxRoute(routeResync()).
LinuxRoute(routeResyncIPv6()).

with

LinuxRoute(routeModified()).
LinuxRoute(routeModifiedIPv6()).

Add the following code at the end of AfterInit method (at line 129):

ctx, p.cancelResync = context.WithCancel(context.Background())
p.wg.Add(1)
go p.resync2(ctx, *timeout*3)

Then build and run the example.
The log of the last resync transaction contains the following:

  * executed operations (2021-11-30 17:24:49.56 +0100 CET -> 2021-11-30 17:24:49.58 +0100 CET, dur: 21ms):
      1. UPDATE:
          - key: config/linux/l3/v2/route/aaa1::/64/linux-tap2
          - prev-value: { outgoing_interface:"linux-tap2"  scope:GLOBAL  dst_network:"aaa1::/64"  metric:500 } 
          - new-value: { outgoing_interface:"linux-tap2"  scope:LINK  dst_network:"aaa1::/64"  metric:500 } 
      2. CREATE [PROPERTY WAS-MISSING]:
          - key: linux/link-local-route/linux-tap2/dest-address/aaa1::/64
          - value: <EMPTY> 

There should be no executed operations.
This shows that the LINK scope has not been configured.

plugins/linux/l3plugin/descriptor/route.go Outdated Show resolved Hide resolved
plugins/linux/l3plugin/descriptor/route.go Show resolved Hide resolved
examples/localclient_linux/route/main.go Outdated Show resolved Hide resolved
examples/localclient_linux/route/main.go Outdated Show resolved Hide resolved
mhalaj1
mhalaj1 previously approved these changes Dec 3, 2021
* the metric change causes the linux route to recreate instead of replacing
  (which led to the creation of a new route instead)
* for IPv6, the metric 0 and 1024 is considered equal (based on how Linux
  treats it)

Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
@ondrej-fabry ondrej-fabry merged commit df3326a into ligato:master Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants