mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 05:58:01 +02:00
ip6: remove standalone DHCP method since DHCPv6 can't provide gateways
All IPv6 enabled sites are expected to provide router advertisement support apparently. If standalone DHCP is really used in the wild then we can clearly re-enable it later.
This commit is contained in:
parent
d0ec39e66d
commit
a729d2f649
5 changed files with 35 additions and 56 deletions
|
|
@ -471,8 +471,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
|
||||||
NM_SETTING_IP6_CONFIG_ADDRESSES);
|
NM_SETTING_IP6_CONFIG_ADDRESSES);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)
|
} else if (!strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)) {
|
||||||
|| !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
|
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
} else {
|
} else {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
|
|
@ -613,34 +612,30 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
|
||||||
* NMSettingIP6Config:method:
|
* NMSettingIP6Config:method:
|
||||||
*
|
*
|
||||||
* IPv6 configuration method. If 'auto' is specified then the appropriate
|
* IPv6 configuration method. If 'auto' is specified then the appropriate
|
||||||
* automatic method (DHCP, PPP, advertisement, etc) is used for the
|
* automatic method (DHCP, PPP, router advertisement, etc) is used for the
|
||||||
* interface and most other properties can be left unset. To force the use
|
* interface and most other properties can be left unset. If 'link-local'
|
||||||
* of DHCP only, specify 'dhcp'; this method is only valid for ethernet-
|
* is specified, then an IPv6 link-local address will be assigned to the
|
||||||
* based hardware. If 'link-local' is specified, then an IPv6 link-local
|
* interface. If 'manual' is specified, static IP addressing is used and
|
||||||
* address will be assigned to the interface. If 'manual' is specified,
|
* at least one IP address must be given in the 'addresses' property. If
|
||||||
* static IP addressing is used and at least one IP address must be given
|
* 'ignored' is specified, IPv6 configuration is not done. This property
|
||||||
* in the 'addresses' property. If 'ignored' is specified, IPv6
|
* must be set. NOTE: the 'shared' method are not yet supported.
|
||||||
* configuration is not done. This property must be set. NOTE: the 'shared'
|
|
||||||
* method are not yet supported.
|
|
||||||
**/
|
**/
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
(object_class, PROP_METHOD,
|
(object_class, PROP_METHOD,
|
||||||
g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD,
|
g_param_spec_string (NM_SETTING_IP6_CONFIG_METHOD,
|
||||||
"Method",
|
"Method",
|
||||||
"IPv6 configuration method. If 'auto' is specified "
|
"IPv6 configuration method. If 'auto' is specified "
|
||||||
"then the appropriate automatic method (PPP, router "
|
"then the appropriate automatic method (DHCP, PPP, "
|
||||||
"advertisement, etc) is used for the device and "
|
"router advertisement, etc) is used for the "
|
||||||
"most other properties can be left unset. To force "
|
"interface and most other properties can be left "
|
||||||
"the use of DHCP only, specify 'dhcp'; this method "
|
"unset. If 'link-local' is specified, then an "
|
||||||
"is only valid for ethernet-based hardware. If "
|
"IPv6 link-local address will be assigned to the "
|
||||||
"'link-local' is specified, then an IPv6 link-local "
|
"interface. If 'manual' is specified, static IP "
|
||||||
"address will be assigned to the interface. If "
|
"addressing is used and at least one IP address "
|
||||||
"'manual' is specified, static IP addressing is "
|
"must be given in the 'addresses' property. If "
|
||||||
"used and at least one IP address must be given in "
|
"'ignored' is specified, IPv6 configuration is not "
|
||||||
" the 'addresses' property. If 'ignored' is "
|
"done. This property must be set. NOTE: the "
|
||||||
"specified, IPv6 configuration is not done. This "
|
"'shared' method are not yet supported.",
|
||||||
"property must be set. NOTE: the 'shared' method"
|
|
||||||
"is not yet supported.",
|
|
||||||
NULL,
|
NULL,
|
||||||
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
|
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
|
||||||
|
|
||||||
|
|
@ -766,26 +761,26 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
|
||||||
/**
|
/**
|
||||||
* NMSettingIP6Config:ignore-auto-routes:
|
* NMSettingIP6Config:ignore-auto-routes:
|
||||||
*
|
*
|
||||||
* When the method is set to 'auto' or 'dhcp' and this property is set to
|
* When the method is set to 'auto' and this property is set to TRUE,
|
||||||
* TRUE, automatically configured routes are ignored and only routes
|
* automatically configured routes are ignored and only routes specified
|
||||||
* specified in #NMSettingIP6Config:routes, if any, are used.
|
* in #NMSettingIP6Config:routes, if any, are used.
|
||||||
**/
|
**/
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
(object_class, PROP_IGNORE_AUTO_ROUTES,
|
(object_class, PROP_IGNORE_AUTO_ROUTES,
|
||||||
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES,
|
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES,
|
||||||
"Ignore automatic routes",
|
"Ignore automatic routes",
|
||||||
"When the method is set to 'auto' or 'dhcp' and this "
|
"When the method is set to 'auto' and this property "
|
||||||
"property is set to TRUE, automatically configured "
|
"is set to TRUE, automatically configured routes are "
|
||||||
"routes are ignored and only routes specified in the "
|
"ignored and only routes specified in the 'routes' "
|
||||||
"'routes' property, if any, are used.",
|
"property, if any, are used.",
|
||||||
FALSE,
|
FALSE,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NMSettingIP6Config:ignore-auto-dns:
|
* NMSettingIP6Config:ignore-auto-dns:
|
||||||
*
|
*
|
||||||
* When the method is set to 'auto' or 'dhcp' and this property is set to
|
* When the method is set to 'auto' and this property is set to TRUE,
|
||||||
* TRUE, automatically configured nameservers and search domains are ignored
|
* automatically configured nameservers and search domains are ignored
|
||||||
* and only nameservers and search domains specified in
|
* and only nameservers and search domains specified in
|
||||||
* #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search, if any, are
|
* #NMSettingIP6Config:dns and #NMSettingIP6Config:dns-search, if any, are
|
||||||
* used.
|
* used.
|
||||||
|
|
@ -794,11 +789,11 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
|
||||||
(object_class, PROP_IGNORE_AUTO_DNS,
|
(object_class, PROP_IGNORE_AUTO_DNS,
|
||||||
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS,
|
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS,
|
||||||
"Ignore DHCPv6/RDNSS DNS",
|
"Ignore DHCPv6/RDNSS DNS",
|
||||||
"When the method is set to 'auto' or 'dhcp' and this "
|
"When the method is set to 'auto' and this property "
|
||||||
"property is set to TRUE, automatically configured "
|
"is set to TRUE, automatically configured nameservers "
|
||||||
"nameservers and search domains are ignored and only "
|
"and search domains are ignored and only nameservers "
|
||||||
"nameservers and search domains specified in the 'dns' "
|
"and search domains specified in 'dns' and 'dns-search' "
|
||||||
"and 'dns-search' properties, if any, are used.",
|
"properties, if any, are used.",
|
||||||
FALSE,
|
FALSE,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,6 @@ GQuark nm_setting_ip6_config_error_quark (void);
|
||||||
|
|
||||||
#define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore"
|
#define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore"
|
||||||
#define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto"
|
#define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto"
|
||||||
#define NM_SETTING_IP6_CONFIG_METHOD_DHCP "dhcp"
|
|
||||||
#define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local"
|
#define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local"
|
||||||
#define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual"
|
#define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual"
|
||||||
#define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared"
|
#define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared"
|
||||||
|
|
|
||||||
|
|
@ -1648,13 +1648,6 @@ real_act_stage3_ip6_config_start (NMDevice *self, NMDeviceStateReason *reason)
|
||||||
}
|
}
|
||||||
nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self));
|
nm_ip6_manager_begin_addrconf (priv->ip6_manager, nm_device_get_ip_ifindex (self));
|
||||||
ret = NM_ACT_STAGE_RETURN_POSTPONE;
|
ret = NM_ACT_STAGE_RETURN_POSTPONE;
|
||||||
} else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
|
|
||||||
/* Router advertisements shouldn't be used in pure DHCP mode */
|
|
||||||
if (priv->ip6_accept_ra_path)
|
|
||||||
nm_utils_do_sysctl (priv->ip6_accept_ra_path, "0\n");
|
|
||||||
|
|
||||||
priv->dhcp6_mode = IP6_DHCP_OPT_MANAGED;
|
|
||||||
ret = dhcp6_start (self, connection, priv->dhcp6_mode, reason);
|
|
||||||
} else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) {
|
} else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) {
|
||||||
/* reset the saved RA value when ipv6 is ignored */
|
/* reset the saved RA value when ipv6 is ignored */
|
||||||
if (priv->ip6_accept_ra_path) {
|
if (priv->ip6_accept_ra_path) {
|
||||||
|
|
@ -2108,8 +2101,7 @@ real_act_stage4_get_ip6_config (NMDevice *self,
|
||||||
*reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
|
*reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
} else if (ip6_method_matches (connection, NM_SETTING_IP6_CONFIG_METHOD_DHCP))
|
}
|
||||||
g_assert (priv->dhcp6_client); /* sanity check */
|
|
||||||
|
|
||||||
/* Autoconf might have triggered DHCPv6 too */
|
/* Autoconf might have triggered DHCPv6 too */
|
||||||
if (priv->dhcp6_client) {
|
if (priv->dhcp6_client) {
|
||||||
|
|
|
||||||
|
|
@ -1389,7 +1389,7 @@ make_ip6_setting (shvarFile *ifcfg,
|
||||||
char *value = NULL;
|
char *value = NULL;
|
||||||
char *str_value;
|
char *str_value;
|
||||||
char *route6_path = NULL;
|
char *route6_path = NULL;
|
||||||
gboolean bool_value, ipv6forwarding, ipv6_autoconf, dhcp6 = FALSE;
|
gboolean bool_value, ipv6forwarding, ipv6_autoconf;
|
||||||
char *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
|
char *method = NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
|
||||||
guint32 i;
|
guint32 i;
|
||||||
shvarFile *network_ifcfg;
|
shvarFile *network_ifcfg;
|
||||||
|
|
@ -1466,12 +1466,9 @@ make_ip6_setting (shvarFile *ifcfg,
|
||||||
/* Find out method property */
|
/* Find out method property */
|
||||||
ipv6forwarding = svTrueValue (ifcfg, "IPV6FORWARDING", FALSE);
|
ipv6forwarding = svTrueValue (ifcfg, "IPV6FORWARDING", FALSE);
|
||||||
ipv6_autoconf = svTrueValue (ifcfg, "IPV6_AUTOCONF", !ipv6forwarding);
|
ipv6_autoconf = svTrueValue (ifcfg, "IPV6_AUTOCONF", !ipv6forwarding);
|
||||||
dhcp6 = svTrueValue (ifcfg, "DHCPV6C", FALSE);
|
|
||||||
|
|
||||||
if (ipv6_autoconf)
|
if (ipv6_autoconf)
|
||||||
method = NM_SETTING_IP6_CONFIG_METHOD_AUTO;
|
method = NM_SETTING_IP6_CONFIG_METHOD_AUTO;
|
||||||
else if (dhcp6)
|
|
||||||
method = NM_SETTING_IP6_CONFIG_METHOD_DHCP;
|
|
||||||
else {
|
else {
|
||||||
/* IPV6_AUTOCONF=no and no IPv6 address -> method 'link-local' */
|
/* IPV6_AUTOCONF=no and no IPv6 address -> method 'link-local' */
|
||||||
str_value = svGetValue (ifcfg, "IPV6ADDR", FALSE);
|
str_value = svGetValue (ifcfg, "IPV6ADDR", FALSE);
|
||||||
|
|
|
||||||
|
|
@ -1271,10 +1271,6 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
||||||
svSetValue (ifcfg, "IPV6INIT", "yes", FALSE);
|
svSetValue (ifcfg, "IPV6INIT", "yes", FALSE);
|
||||||
svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE);
|
svSetValue (ifcfg, "IPV6_AUTOCONF", "yes", FALSE);
|
||||||
svSetValue (ifcfg, "DHCPV6C", NULL, FALSE);
|
svSetValue (ifcfg, "DHCPV6C", NULL, FALSE);
|
||||||
} else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
|
|
||||||
svSetValue (ifcfg, "IPV6INIT", "yes", FALSE);
|
|
||||||
svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE);
|
|
||||||
svSetValue (ifcfg, "DHCPV6C", "yes", FALSE);
|
|
||||||
} else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
|
} else if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
|
||||||
svSetValue (ifcfg, "IPV6INIT", "yes", FALSE);
|
svSetValue (ifcfg, "IPV6INIT", "yes", FALSE);
|
||||||
svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE);
|
svSetValue (ifcfg, "IPV6_AUTOCONF", "no", FALSE);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue