After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729354 - [enh] track both route protocol and source for better connection matching
[enh] track both route protocol and source for better connection matching
Status: RESOLVED DUPLICATE of bug 729203
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-05-01 18:46 UTC by Dan Williams
Modified: 2014-05-08 15:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dan Williams 2014-05-01 18:46:08 UTC
NM needs to do a better job of excluding automatically-generated (RA, DHCP, kernel) routes when matching connections at startup.  To do that, we should do a couple things:

1) track the route's "protocol" (rtnl_route_get_protocol() which returns RTPROT_ defines) independently of the route's source (kernel/ra/etc)

2) set the right route protocol based on the internal route source (eg, NM_PLATFORM_SOURCE_DHCP -> RTPROT_DHCP, NM_PLATFORM_SOURCE_RDISC -> RTPROT_RA) where we have a mapping

3) maybe hijack an RTPROT define for stuff that doesn't have a mapping, so we know it's been added dynamically by NetworkManager?

4) Then, when generating the connection in nm_device_generate_connection(), when adding IP configuration, we somehow tell nm_ip4_config_update_setting() not to add any routes that came from automatic sources like RA/DHCP/etc.

We could refactor the 'source' flag to mean 'protocol' instead, and then simply have a gboolean 'external' flag indicating that the route came from outside NetworkManager.  Thus we could differentiate between an externally-added RA-protocol route (protocol=RA, source=external) and an NM-added RA-protocol route (protocol=RA, source=internal).

---

A second fix is to ignore IPv6 cache routes (flags & RTM_F_CLONED) at the same place, when generating the connection.  These routes are temporarily created by the kernel when attempting to contact another host (even with ping6 when the host doesn't exist) and are destroyed by the kernel shortly after.  They shouldn't be part of the initial connection generation.

---

All this should happen in a generic manner to ensure that the "fake" platform doesn't require rtnetlink #defines or dependencies.
Comment 1 Dan Winship 2014-05-08 15:22:41 UTC

*** This bug has been marked as a duplicate of bug 729203 ***