Skip to content

ndisc: preserve router preferences

Beniamino Galvani requested to merge bg/ndisc-router-pref into main

Summary

If we add multiple default routes with the same metric and different preferences, kernel merges them into a single ECMP route, with overall preference equal to the preference of the first route added. Therefore, the preference of individual routes is not respected.

To avoid that, add routes with different metrics if they have different preferences, so that they are not merged together.

We could configure only the route(s) with highest preference ignoring the others, and the effect would be the same. However, it is better to add all routes so that users can easily see from "ip route" that there are multiple routers available.

See: #1468 (comment 2479786)

#1468 (closed)

Checklist

Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:

  • the subject for all commits is concise and explicative
  • the message for all commits explains the reason for the change
  • the source is properly formatted
  • any relevant documentation is up to date
  • you have added unit tests if applicable
  • the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.
Edited by Beniamino Galvani

Merge request reports

Loading