2008-04-22 Dan Williams <dcbw@redhat.com>
Patch from Charles R. Anderson (cra@wpi.edu) * src/NetworkManagerPolicy.c - (update_routing_and_dns): don't select devices without a gateway as having the default route (rh #437338) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3586 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2008-04-22 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
Patch from Charles R. Anderson (cra@wpi.edu)
|
||||||
|
|
||||||
|
* src/NetworkManagerPolicy.c
|
||||||
|
- (update_routing_and_dns): don't select devices without a gateway
|
||||||
|
as having the default route (rh #437338)
|
||||||
|
|
||||||
2008-04-21 Dan Williams <dcbw@redhat.com>
|
2008-04-21 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* src/nm-activation-request.c
|
* src/nm-activation-request.c
|
||||||
|
@@ -138,11 +138,29 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update)
|
|||||||
connection = nm_act_request_get_connection (req);
|
connection = nm_act_request_get_connection (req);
|
||||||
g_assert (connection);
|
g_assert (connection);
|
||||||
|
|
||||||
/* Never set the default route through an IPv4LL-addressed device */
|
|
||||||
s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG);
|
s_ip4 = (NMSettingIP4Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG);
|
||||||
if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP))
|
if (s_ip4) {
|
||||||
|
GSList *addr_iter;
|
||||||
|
gboolean have_gateway = FALSE;
|
||||||
|
|
||||||
|
/* Never set the default route through an IPv4LL-addressed device */
|
||||||
|
if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Never set the default route through a device that doesn't have a gateway */
|
||||||
|
for (addr_iter = s_ip4->addresses; addr_iter; addr_iter = g_slist_next (addr_iter)) {
|
||||||
|
NMSettingIP4Address *addr = (NMSettingIP4Address *) addr_iter->data;
|
||||||
|
|
||||||
|
if (addr->gateway) {
|
||||||
|
have_gateway = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!have_gateway)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
prio = get_device_priority (dev);
|
prio = get_device_priority (dev);
|
||||||
if (prio > best_prio) {
|
if (prio > best_prio) {
|
||||||
best = dev;
|
best = dev;
|
||||||
|
Reference in New Issue
Block a user