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 740780 - [review] iface-helper: disambiguate route priority for IPv4 and IPv6
[review] iface-helper: disambiguate route priority for IPv4 and IPv6
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-11-26 20:23 UTC by Thomas Haller
Modified: 2014-12-01 16:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: rename NM_PLATFORM_ROUTE_METRIC_DEFAULT to NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6 (3.17 KB, patch)
2014-11-26 20:25 UTC, Thomas Haller
reviewed Details | Review
iface-helper: disambiguate route priority for IPv4 and IPv6 (5.42 KB, patch)
2014-11-26 20:25 UTC, Thomas Haller
reviewed Details | Review

Description Thomas Haller 2014-11-26 20:23:53 UTC
Patches attached...
Comment 1 Thomas Haller 2014-11-26 20:25:05 UTC
Created attachment 291587 [details] [review]
core: rename NM_PLATFORM_ROUTE_METRIC_DEFAULT to NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6

For IPv4, iproute for example defaults to a metric of 0.
Hence, the name NM_PLATFORM_ROUTE_METRIC_DEFAULT was misleading.

Also add a NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP4 define for completeness.
Comment 2 Thomas Haller 2014-11-26 20:25:11 UTC
Created attachment 291588 [details] [review]
iface-helper: disambiguate route priority for IPv4 and IPv6
Comment 3 Dan Winship 2014-12-01 11:33:21 UTC
Comment on attachment 291587 [details] [review]
core: rename NM_PLATFORM_ROUTE_METRIC_DEFAULT to NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6

sure
Comment 4 Dan Winship 2014-12-01 11:35:18 UTC
Comment on attachment 291588 [details] [review]
iface-helper: disambiguate route priority for IPv4 and IPv6

> 		g_ptr_array_add (argv, g_strdup_printf ("%u", nm_dhcp_client_get_priority (priv->dhcp4_client)));

>+		g_ptr_array_add (argv, g_strdup_printf ("%u", nm_device_get_ip6_route_metric (self)));

why do we use an NMDHCPClient method for 4, but an NMDevice method for 6?
Comment 5 Thomas Haller 2014-12-01 12:34:11 UTC
(In reply to comment #4)
> (From update of attachment 291588 [details] [review])
> > 		g_ptr_array_add (argv, g_strdup_printf ("%u", nm_dhcp_client_get_priority (priv->dhcp4_client)));
> 
> >+		g_ptr_array_add (argv, g_strdup_printf ("%u", nm_device_get_ip6_route_metric (self)));
> 
> why do we use an NMDHCPClient method for 4, but an NMDevice method for 6?

I kept the pre-existing behavior. But both should yield the same result. Anyway, good point, I changed it (fixup!).

Pushed patches to th/iface_helper_priority_bgo740780
Comment 6 Dan Williams 2014-12-01 15:18:53 UTC
> iface-helper: disambiguate route priority for IPv4 and IPv6

The same short argument "-p" is used for v4 and v6 priority:

+		{ "priority4", 'p', 0, G_OPTION_ARG_INT64, &priority64_v4, N_("Route priority for IPv4"), N_("0") },
+		{ "priority6", 'p', 0, G_OPTION_ARG_INT64, &priority64_v6, N_("Route priority for IPv6"), N_("1024") },

That should be changed.