2008-08-01 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting-ip4-config.c libnm-util/nm-setting-ip4-config.h - Make IPv4 methods reflect their usage; 'dhcp' -> 'auto' and 'autoip' -> 'link-local'. VPN & PPP connections can also have IPv4 settings, and they don't necessarily use DHCP. * src/NetworkManagerPolicy.c src/nm-device.c system-settings/plugins/ifcfg-fedora/reader.c system-settings/plugins/ifcfg-suse/parser.c - Fixup for method changes git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3882 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
14
ChangeLog
14
ChangeLog
@@ -1,3 +1,17 @@
|
|||||||
|
2008-08-01 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
* libnm-util/nm-setting-ip4-config.c
|
||||||
|
libnm-util/nm-setting-ip4-config.h
|
||||||
|
- Make IPv4 methods reflect their usage; 'dhcp' -> 'auto' and
|
||||||
|
'autoip' -> 'link-local'. VPN & PPP connections can also have IPv4
|
||||||
|
settings, and they don't necessarily use DHCP.
|
||||||
|
|
||||||
|
* src/NetworkManagerPolicy.c
|
||||||
|
src/nm-device.c
|
||||||
|
system-settings/plugins/ifcfg-fedora/reader.c
|
||||||
|
system-settings/plugins/ifcfg-suse/parser.c
|
||||||
|
- Fixup for method changes
|
||||||
|
|
||||||
2008-07-31 Dan Williams <dcbw@redhat.com>
|
2008-07-31 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* src/nm-activation-request.c
|
* src/nm-activation-request.c
|
||||||
|
@@ -112,7 +112,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
|
|||||||
NM_SETTING_IP4_CONFIG_ADDRESSES);
|
NM_SETTING_IP4_CONFIG_ADDRESSES);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else if ( !strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP)
|
} else if ( !strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)
|
||||||
|| !strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) {
|
|| !strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) {
|
||||||
if (self->dns && self->dns->len) {
|
if (self->dns && self->dns->len) {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
@@ -137,7 +137,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
|
|||||||
NM_SETTING_IP4_CONFIG_ADDRESSES);
|
NM_SETTING_IP4_CONFIG_ADDRESSES);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else if (!strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_DHCP)) {
|
} else if (!strcmp (self->method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
} else {
|
} else {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
|
@@ -62,10 +62,10 @@ GQuark nm_setting_ip4_config_error_quark (void);
|
|||||||
#define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id"
|
#define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id"
|
||||||
#define NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME "dhcp-hostname"
|
#define NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME "dhcp-hostname"
|
||||||
|
|
||||||
#define NM_SETTING_IP4_CONFIG_METHOD_DHCP "dhcp"
|
#define NM_SETTING_IP4_CONFIG_METHOD_AUTO "auto"
|
||||||
#define NM_SETTING_IP4_CONFIG_METHOD_AUTOIP "autoip"
|
#define NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL "link-local"
|
||||||
#define NM_SETTING_IP4_CONFIG_METHOD_MANUAL "manual"
|
#define NM_SETTING_IP4_CONFIG_METHOD_MANUAL "manual"
|
||||||
#define NM_SETTING_IP4_CONFIG_METHOD_SHARED "shared"
|
#define NM_SETTING_IP4_CONFIG_METHOD_SHARED "shared"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
guint32 address; /* network byte order */
|
guint32 address; /* network byte order */
|
||||||
|
@@ -149,7 +149,7 @@ update_routing_and_dns (NMPolicy *policy, gboolean force_update)
|
|||||||
|
|
||||||
/* Never set the default route through an IPv4LL-addressed device */
|
/* 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 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Make sure at least one of this device's IP addresses has a gateway */
|
/* Make sure at least one of this device's IP addresses has a gateway */
|
||||||
|
@@ -649,7 +649,7 @@ nm_device_handle_autoip4_event (NMDevice *self,
|
|||||||
|
|
||||||
/* Ignore if the connection isn't an AutoIP connection */
|
/* Ignore if the connection isn't an AutoIP connection */
|
||||||
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 || !s_ip4->method || strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP))
|
if (!s_ip4 || !s_ip4->method || strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
iface = nm_device_get_iface (self);
|
iface = nm_device_get_iface (self);
|
||||||
@@ -828,7 +828,7 @@ real_act_stage3_ip_config_start (NMDevice *self, NMDeviceStateReason *reason)
|
|||||||
NM_TYPE_SETTING_IP4_CONFIG);
|
NM_TYPE_SETTING_IP4_CONFIG);
|
||||||
|
|
||||||
/* If we did not receive IP4 configuration information, default to DHCP */
|
/* If we did not receive IP4 configuration information, default to DHCP */
|
||||||
if (!s_ip4 || !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_DHCP)) {
|
if (!s_ip4 || !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
|
||||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||||
gboolean success;
|
gboolean success;
|
||||||
|
|
||||||
@@ -850,7 +850,7 @@ real_act_stage3_ip_config_start (NMDevice *self, NMDeviceStateReason *reason)
|
|||||||
*reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED;
|
*reason = NM_DEVICE_STATE_REASON_DHCP_START_FAILED;
|
||||||
ret = NM_ACT_STAGE_RETURN_FAILURE;
|
ret = NM_ACT_STAGE_RETURN_FAILURE;
|
||||||
}
|
}
|
||||||
} else if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP)) {
|
} else if (s_ip4 && !strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) {
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
/* Start avahi-autoipd */
|
/* Start avahi-autoipd */
|
||||||
@@ -1026,7 +1026,7 @@ real_act_stage4_get_ip4_config (NMDevice *self,
|
|||||||
g_assert (s_ip4);
|
g_assert (s_ip4);
|
||||||
g_assert (s_ip4->method);
|
g_assert (s_ip4->method);
|
||||||
|
|
||||||
if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_AUTOIP)) {
|
if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) {
|
||||||
*config = aipd_get_ip4_config (self, reason);
|
*config = aipd_get_ip4_config (self, reason);
|
||||||
} else if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
|
} else if (!strcmp (s_ip4->method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL)) {
|
||||||
*config = nm_ip4_config_new ();
|
*config = nm_ip4_config_new ();
|
||||||
|
@@ -169,12 +169,12 @@ make_ip4_setting (shvarFile *ifcfg, GError **error)
|
|||||||
|
|
||||||
value = svGetValue (ifcfg, "BOOTPROTO");
|
value = svGetValue (ifcfg, "BOOTPROTO");
|
||||||
if (value && (!g_ascii_strcasecmp (value, "bootp") || !g_ascii_strcasecmp (value, "dhcp")))
|
if (value && (!g_ascii_strcasecmp (value, "bootp") || !g_ascii_strcasecmp (value, "dhcp")))
|
||||||
method = NM_SETTING_IP4_CONFIG_METHOD_DHCP;
|
method = NM_SETTING_IP4_CONFIG_METHOD_AUTO;
|
||||||
|
|
||||||
if (value && !g_ascii_strcasecmp (value, "autoip")) {
|
if (value && !g_ascii_strcasecmp (value, "autoip")) {
|
||||||
g_free (value);
|
g_free (value);
|
||||||
s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
|
s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new ();
|
||||||
s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_AUTOIP);
|
s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL);
|
||||||
return NM_SETTING (s_ip4);
|
return NM_SETTING (s_ip4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ make_ip4_setting (shvarFile *ifcfg, GError **error)
|
|||||||
s_ip4->ignore_dhcp_dns = !svTrueValue (ifcfg, "PEERDNS", 1);
|
s_ip4->ignore_dhcp_dns = !svTrueValue (ifcfg, "PEERDNS", 1);
|
||||||
|
|
||||||
/* DHCP hostname for 'send host-name' option */
|
/* DHCP hostname for 'send host-name' option */
|
||||||
if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_DHCP)) {
|
if (!strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_AUTO)) {
|
||||||
value = svGetValue (ifcfg, "DHCP_HOSTNAME");
|
value = svGetValue (ifcfg, "DHCP_HOSTNAME");
|
||||||
if (value && strlen (value))
|
if (value && strlen (value))
|
||||||
s_ip4->dhcp_hostname = g_strdup (value);
|
s_ip4->dhcp_hostname = g_strdup (value);
|
||||||
|
@@ -108,11 +108,11 @@ make_ip4_setting (shvarFile *ifcfg)
|
|||||||
str = svGetValue (ifcfg, "BOOTPROTO");
|
str = svGetValue (ifcfg, "BOOTPROTO");
|
||||||
if (str) {
|
if (str) {
|
||||||
if (!g_ascii_strcasecmp (str, "bootp") || !g_ascii_strcasecmp (str, "dhcp"))
|
if (!g_ascii_strcasecmp (str, "bootp") || !g_ascii_strcasecmp (str, "dhcp"))
|
||||||
s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_DHCP);
|
s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_AUTO);
|
||||||
else if (!g_ascii_strcasecmp (str, "static"))
|
else if (!g_ascii_strcasecmp (str, "static"))
|
||||||
s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
|
s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_MANUAL);
|
||||||
else if (!g_ascii_strcasecmp (str, "autoip"))
|
else if (!g_ascii_strcasecmp (str, "autoip"))
|
||||||
s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_AUTOIP);
|
s_ip4->method = g_strdup (NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL);
|
||||||
|
|
||||||
g_free (str);
|
g_free (str);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user