mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
2008-04-22 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerPolicy.c - (update_routing_and_dns): when checking for a gateway, look at the composite IP4 config, not the connection's ip4-config setting, which doesn't include DHCP-returned information git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3589 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
62b25d72f0
commit
805187cb87
|
@ -1,3 +1,10 @@
|
||||||
|
2008-04-22 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
* src/NetworkManagerPolicy.c
|
||||||
|
- (update_routing_and_dns): when checking for a gateway, look at the
|
||||||
|
composite IP4 config, not the connection's ip4-config setting, which
|
||||||
|
doesn't include DHCP-returned information
|
||||||
|
|
||||||
2008-04-22 Tambet Ingo <tambet@gmail.com>
|
2008-04-22 Tambet Ingo <tambet@gmail.com>
|
||||||
|
|
||||||
Implement GKeyFile system settings plugin.
|
Implement GKeyFile system settings plugin.
|
||||||
|
|
|
@ -126,11 +126,15 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update)
|
||||||
NMDevice *dev = NM_DEVICE (iter->data);
|
NMDevice *dev = NM_DEVICE (iter->data);
|
||||||
NMActRequest *req;
|
NMActRequest *req;
|
||||||
NMConnection *connection;
|
NMConnection *connection;
|
||||||
|
NMIP4Config *ip4_config;
|
||||||
NMSettingIP4Config *s_ip4;
|
NMSettingIP4Config *s_ip4;
|
||||||
guint32 prio;
|
guint32 prio;
|
||||||
|
|
||||||
if ( (nm_device_get_state (dev) != NM_DEVICE_STATE_ACTIVATED)
|
if (nm_device_get_state (dev) != NM_DEVICE_STATE_ACTIVATED)
|
||||||
|| !nm_device_get_ip4_config (dev))
|
continue;
|
||||||
|
|
||||||
|
ip4_config = nm_device_get_ip4_config (dev);
|
||||||
|
if (!ip4_config)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
req = nm_device_get_act_request (dev);
|
req = nm_device_get_act_request (dev);
|
||||||
|
@ -138,28 +142,14 @@ 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) {
|
if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP))
|
||||||
GSList *addr_iter;
|
continue;
|
||||||
gboolean have_gateway = FALSE;
|
|
||||||
|
|
||||||
/* Never set the default route through an IPv4LL-addressed device */
|
/* FIXME: handle more than one IP address */
|
||||||
if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP))
|
if (!nm_ip4_config_get_gateway (ip4_config))
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in a new issue