2020-12-23 22:21:36 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2014-07-24 08:53:33 -04:00
|
|
|
/*
|
2019-10-01 09:20:35 +02:00
|
|
|
* Copyright (C) 2007 - 2014 Red Hat, Inc.
|
2014-07-24 08:53:33 -04:00
|
|
|
*/
|
|
|
|
|
|
2021-02-12 15:01:09 +01:00
|
|
|
#include "libnm-core-impl/nm-default-libnm-core.h"
|
2016-02-19 14:57:48 +01:00
|
|
|
|
2016-02-12 14:44:52 +01:00
|
|
|
#include "nm-setting-ip6-config.h"
|
|
|
|
|
|
2016-04-30 16:48:02 +02:00
|
|
|
#include <arpa/inet.h>
|
2014-07-24 08:53:33 -04:00
|
|
|
|
|
|
|
|
#include "nm-setting-private.h"
|
2021-06-29 21:53:55 +02:00
|
|
|
#include "nm-utils-private.h"
|
2014-06-26 16:47:46 -04:00
|
|
|
#include "nm-core-enum-types.h"
|
2021-02-12 15:01:09 +01:00
|
|
|
#include "libnm-core-intern/nm-core-internal.h"
|
2014-07-24 08:53:33 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SECTION:nm-setting-ip6-config
|
|
|
|
|
* @short_description: Describes IPv6 addressing, routing, and name service properties
|
|
|
|
|
*
|
|
|
|
|
* The #NMSettingIP6Config object is a #NMSetting subclass that describes
|
|
|
|
|
* properties related to IPv6 addressing, routing, and Domain Name Service
|
2014-10-19 17:30:10 -04:00
|
|
|
*
|
|
|
|
|
* #NMSettingIP6Config has few properties or methods of its own; it inherits
|
|
|
|
|
* almost everything from #NMSettingIPConfig.
|
|
|
|
|
*
|
2019-04-26 13:25:21 +02:00
|
|
|
* NetworkManager supports 7 values for the #NMSettingIPConfig:method property
|
2014-10-19 17:30:10 -04:00
|
|
|
* for IPv6. If "auto" is specified then the appropriate automatic method (PPP,
|
|
|
|
|
* router advertisement, etc) is used for the device and most other properties
|
|
|
|
|
* can be left unset. To force the use of DHCP only, specify "dhcp"; this
|
|
|
|
|
* method is only valid for Ethernet- based hardware. If "link-local" is
|
|
|
|
|
* specified, then an IPv6 link-local address will be assigned to the interface.
|
|
|
|
|
* If "manual" is specified, static IP addressing is used and at least one IP
|
|
|
|
|
* address must be given in the "addresses" property. If "ignore" is specified,
|
|
|
|
|
* IPv6 configuration is not done. Note: the "shared" method is not yet
|
2019-04-26 13:25:21 +02:00
|
|
|
* supported. If "disabled" is specified, IPv6 is disabled completely for the
|
|
|
|
|
* interface.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
|
|
|
|
|
2019-01-11 08:32:54 +01:00
|
|
|
/*****************************************************************************/
|
2014-07-24 08:53:33 -04:00
|
|
|
|
2019-01-11 08:32:54 +01:00
|
|
|
NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_IP6_PRIVACY,
|
|
|
|
|
PROP_ADDR_GEN_MODE,
|
|
|
|
|
PROP_TOKEN,
|
|
|
|
|
PROP_DHCP_DUID,
|
2022-05-19 15:27:38 -06:00
|
|
|
PROP_RA_TIMEOUT,
|
2022-10-24 17:08:02 +02:00
|
|
|
PROP_MTU,
|
|
|
|
|
PROP_DHCP_PD_HINT, );
|
2014-07-24 08:53:33 -04:00
|
|
|
|
|
|
|
|
typedef struct {
|
2021-06-28 18:14:04 +02:00
|
|
|
NMSettingIPConfigPrivate parent;
|
|
|
|
|
|
2022-05-19 15:27:38 -06:00
|
|
|
char *token;
|
|
|
|
|
char *dhcp_duid;
|
2022-10-24 17:08:02 +02:00
|
|
|
char *dhcp_pd_hint;
|
2022-05-19 15:27:38 -06:00
|
|
|
int ip6_privacy;
|
|
|
|
|
gint32 addr_gen_mode;
|
|
|
|
|
gint32 ra_timeout;
|
|
|
|
|
guint32 mtu;
|
2014-07-24 08:53:33 -04:00
|
|
|
} NMSettingIP6ConfigPrivate;
|
|
|
|
|
|
2021-06-11 00:27:31 +02:00
|
|
|
/**
|
|
|
|
|
* NMSettingIP6Config:
|
|
|
|
|
*
|
|
|
|
|
* IPv6 Settings
|
|
|
|
|
*/
|
|
|
|
|
struct _NMSettingIP6Config {
|
libnm: embed private structure in NMSetting and avoid g_type_class_add_private()
Historically, the NMSetting types were in public headers. Theoretically,
that allowed users to subtype our classes. However in practice that was
impossible because they lacked required access to internal functions to
fully create an NMSetting class outside of libnm. And it also was not
useful, because you simply cannot extend libnm by subtyping a libnm
class. And supporting such a use case would be hard and limit what we can
do in libnm.
Having GObject structs in public headers also require that we don't
change it's layout. The ABI of those structs must not change, if anybody
out there was actually subclassing our GObjects.
In libnm 1.34 (commit e46d484fae9e ('libnm: hide NMSetting types from
public headers')) we moved the structs from headers to internal.
This would have caused a compiler error if anybody was using those
struct definitions. However, we still didn't change the ABI/layout so
that we didn't break users who relied on it (for whatever reason).
It doesn't seem there were any affected user. We waited long enough.
Change internal ABI.
No longer use g_type_class_add_private(). Instead, embed the private
structs directly (_NM_GET_PRIVATE()) or indirectly
(_NM_GET_PRIVATE_PTR()) in the object.
The main benefit is for debugging in the debugger, where we can now
easily find the private data. Previously that was so cumbersome to be
effectively impossible.
It's also the fastest possible way, since NM_SETTING_*_GET_PRIVATE()
literally resolves to "&self->_priv" (plus static asserts and
nm_assert() for type checking).
_NM_GET_PRIVATE() also propagates constness and requires that the
argument is a compatible pointer type (at compile time).
Note that g_type_class_add_private() is also deprecated in glib 2.58 and
replaced by G_ADD_PRIVATE(). For one, we still don't rely on 2.58. Also,
G_ADD_PRIVATE() is a worse solution as it supports a usecase that we
don't care for (public structs in headers). _NM_GET_PRIVATE() is still
faster, works with older glib and most importantly: is better for
debugging as you can find the private data from an object pointer.
For NMSettingIPConfig this is rather awkward, because all direct
properties require a common "klass->private_offset". This was however
the case before this change. Nothing new here. And if you ever touch
this and do something wrong, many unit tests will fail. It's almost
impossible to get wrong, albeit it can be confusing to understand.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1773
2023-10-24 19:05:50 +02:00
|
|
|
NMSettingIPConfig parent;
|
|
|
|
|
NMSettingIP6ConfigPrivate _priv;
|
2021-06-11 00:27:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct _NMSettingIP6ConfigClass {
|
|
|
|
|
NMSettingIPConfigClass parent;
|
|
|
|
|
};
|
|
|
|
|
|
2019-01-11 08:32:54 +01:00
|
|
|
G_DEFINE_TYPE(NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING_IP_CONFIG)
|
2014-07-24 08:53:33 -04:00
|
|
|
|
2019-01-11 08:32:54 +01:00
|
|
|
#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) \
|
libnm: embed private structure in NMSetting and avoid g_type_class_add_private()
Historically, the NMSetting types were in public headers. Theoretically,
that allowed users to subtype our classes. However in practice that was
impossible because they lacked required access to internal functions to
fully create an NMSetting class outside of libnm. And it also was not
useful, because you simply cannot extend libnm by subtyping a libnm
class. And supporting such a use case would be hard and limit what we can
do in libnm.
Having GObject structs in public headers also require that we don't
change it's layout. The ABI of those structs must not change, if anybody
out there was actually subclassing our GObjects.
In libnm 1.34 (commit e46d484fae9e ('libnm: hide NMSetting types from
public headers')) we moved the structs from headers to internal.
This would have caused a compiler error if anybody was using those
struct definitions. However, we still didn't change the ABI/layout so
that we didn't break users who relied on it (for whatever reason).
It doesn't seem there were any affected user. We waited long enough.
Change internal ABI.
No longer use g_type_class_add_private(). Instead, embed the private
structs directly (_NM_GET_PRIVATE()) or indirectly
(_NM_GET_PRIVATE_PTR()) in the object.
The main benefit is for debugging in the debugger, where we can now
easily find the private data. Previously that was so cumbersome to be
effectively impossible.
It's also the fastest possible way, since NM_SETTING_*_GET_PRIVATE()
literally resolves to "&self->_priv" (plus static asserts and
nm_assert() for type checking).
_NM_GET_PRIVATE() also propagates constness and requires that the
argument is a compatible pointer type (at compile time).
Note that g_type_class_add_private() is also deprecated in glib 2.58 and
replaced by G_ADD_PRIVATE(). For one, we still don't rely on 2.58. Also,
G_ADD_PRIVATE() is a worse solution as it supports a usecase that we
don't care for (public structs in headers). _NM_GET_PRIVATE() is still
faster, works with older glib and most importantly: is better for
debugging as you can find the private data from an object pointer.
For NMSettingIPConfig this is rather awkward, because all direct
properties require a common "klass->private_offset". This was however
the case before this change. Nothing new here. And if you ever touch
this and do something wrong, many unit tests will fail. It's almost
impossible to get wrong, albeit it can be confusing to understand.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1773
2023-10-24 19:05:50 +02:00
|
|
|
_NM_GET_PRIVATE(o, NMSettingIP6Config, NM_IS_SETTING_IP6_CONFIG, NMSettingIPConfig, NMSetting)
|
2019-01-11 08:32:54 +01:00
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2014-07-24 08:53:33 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_setting_ip6_config_get_ip6_privacy:
|
|
|
|
|
* @setting: the #NMSettingIP6Config
|
|
|
|
|
*
|
|
|
|
|
* Returns the value contained in the #NMSettingIP6Config:ip6-privacy
|
|
|
|
|
* property.
|
|
|
|
|
*
|
|
|
|
|
* Returns: IPv6 Privacy Extensions configuration value (#NMSettingIP6ConfigPrivacy).
|
|
|
|
|
**/
|
|
|
|
|
NMSettingIP6ConfigPrivacy
|
|
|
|
|
nm_setting_ip6_config_get_ip6_privacy(NMSettingIP6Config *setting)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail(NM_IS_SETTING_IP6_CONFIG(setting), NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN);
|
|
|
|
|
|
|
|
|
|
return NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting)->ip6_privacy;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-24 17:08:02 +02:00
|
|
|
/**
|
|
|
|
|
* nm_setting_ip6_config_get_dhcp_pd_hint:
|
|
|
|
|
* @setting: the #NMSettingIP6Config
|
|
|
|
|
*
|
|
|
|
|
* Returns the value contained in the #NMSettingIP6Config:dhcp-pd-hint
|
|
|
|
|
* property.
|
|
|
|
|
*
|
|
|
|
|
* Returns: a string containing an address and prefix length to be used
|
|
|
|
|
* as hint for DHCPv6 prefix delegation.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.44
|
|
|
|
|
**/
|
|
|
|
|
const char *
|
|
|
|
|
nm_setting_ip6_config_get_dhcp_pd_hint(NMSettingIP6Config *setting)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail(NM_IS_SETTING_IP6_CONFIG(setting), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting)->dhcp_pd_hint;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-08 20:22:17 +02:00
|
|
|
/**
|
|
|
|
|
* nm_setting_ip6_config_get_addr_gen_mode:
|
|
|
|
|
* @setting: the #NMSettingIP6Config
|
|
|
|
|
*
|
|
|
|
|
* Returns the value contained in the #NMSettingIP6Config:addr-gen-mode
|
|
|
|
|
* property.
|
|
|
|
|
*
|
|
|
|
|
* Returns: IPv6 Address Generation Mode.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.2
|
|
|
|
|
**/
|
|
|
|
|
NMSettingIP6ConfigAddrGenMode
|
|
|
|
|
nm_setting_ip6_config_get_addr_gen_mode(NMSettingIP6Config *setting)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail(NM_IS_SETTING_IP6_CONFIG(setting),
|
all: make "ipv6.addr-gen-mode" configurable by global default
It can be useful to choose a different "ipv6.addr-gen-mode". And it can be
useful to override the default for a set of profiles.
For example, in cloud or in a data center, stable-privacy might not be
the best choice. Add a mechanism to override the default via global defaults
in NetworkManager.conf:
# /etc/NetworkManager/conf.d/90-ipv6-addr-gen-mode-override.conf
[connection-90-ipv6-addr-gen-mode-override]
match-device=type:ethernet
ipv6.addr-gen-mode=0
"ipv6.addr-gen-mode" is a special property, because its default depends on
the component that configures the profile.
- when read from disk (keyfile and ifcfg-rh), a missing addr-gen-mode
key means to default to "eui64".
- when configured via D-Bus, a missing addr-gen-mode property means to
default to "stable-privacy".
- libnm's ip6-config::addr-gen-mode property defaults to
"stable-privacy".
- when some tool creates a profile, they either can explicitly
set the mode, or they get the default of the underlying mechanisms
above.
- nm-initrd-generator explicitly sets "eui64" for profiles it creates.
- nmcli doesn' explicitly set it, but inherits the default form
libnm's ip6-config::addr-gen-mode.
- when NM creates a auto-default-connection for ethernet ("Wired connection 1"),
it inherits the default from libnm's ip6-config::addr-gen-mode.
Global connection defaults only take effect when the per-profile
value is set to a special default/unset value. To account for the
different cases above, we add two such special values: "default" and
"default-or-eui64". That's something we didn't do before, but it seams
useful and easy to understand.
Also, this neatly expresses the current behaviors we already have. E.g.
if you don't specify the "addr-gen-mode" in a keyfile, "default-or-eui64"
is a pretty clear thing.
Note that usually we cannot change default values, in particular not for
libnm's properties. That is because we don't serialize the default
values to D-Bus/keyfile, so if we change the default, we change
behavior. Here we change from "stable-privacy" to "default" and
from "eui64" to "default-or-eui64". That means, the user only experiences
a change in behavior, if they have a ".conf" file that overrides the default.
https://bugzilla.redhat.com/show_bug.cgi?id=1743161
https://bugzilla.redhat.com/show_bug.cgi?id=2082682
See-also: https://github.com/coreos/fedora-coreos-tracker/issues/907
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1213
2022-05-06 16:57:51 +02:00
|
|
|
NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT);
|
2015-09-08 20:22:17 +02:00
|
|
|
|
|
|
|
|
return NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting)->addr_gen_mode;
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-30 16:48:02 +02:00
|
|
|
/**
|
|
|
|
|
* nm_setting_ip6_config_get_token:
|
|
|
|
|
* @setting: the #NMSettingIP6Config
|
|
|
|
|
*
|
|
|
|
|
* Returns the value contained in the #NMSettingIP6Config:token
|
|
|
|
|
* property.
|
|
|
|
|
*
|
|
|
|
|
* Returns: A string.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.4
|
|
|
|
|
**/
|
|
|
|
|
const char *
|
|
|
|
|
nm_setting_ip6_config_get_token(NMSettingIP6Config *setting)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail(NM_IS_SETTING_IP6_CONFIG(setting), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting)->token;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-06 16:10:01 +01:00
|
|
|
/**
|
|
|
|
|
* nm_setting_ip6_config_get_dhcp_duid:
|
|
|
|
|
* @setting: the #NMSettingIP6Config
|
|
|
|
|
*
|
|
|
|
|
* Returns the value contained in the #NMSettingIP6Config:dhcp-duid
|
|
|
|
|
* property.
|
|
|
|
|
*
|
|
|
|
|
* Returns: The configured DUID value to be included in the DHCPv6 requests
|
|
|
|
|
* sent to the DHCPv6 servers.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.12
|
|
|
|
|
**/
|
|
|
|
|
const char *
|
|
|
|
|
nm_setting_ip6_config_get_dhcp_duid(NMSettingIP6Config *setting)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail(NM_IS_SETTING_IP6_CONFIG(setting), NULL);
|
|
|
|
|
|
|
|
|
|
return NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting)->dhcp_duid;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-13 15:41:35 +01:00
|
|
|
/**
|
|
|
|
|
* nm_setting_ip6_config_get_ra_timeout:
|
|
|
|
|
* @setting: the #NMSettingIP6Config
|
|
|
|
|
*
|
|
|
|
|
* Returns: The configured %NM_SETTING_IP6_CONFIG_RA_TIMEOUT value with the
|
|
|
|
|
* timeout for router advertisements in seconds.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.24
|
|
|
|
|
**/
|
|
|
|
|
gint32
|
|
|
|
|
nm_setting_ip6_config_get_ra_timeout(NMSettingIP6Config *setting)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail(NM_IS_SETTING_IP6_CONFIG(setting), 0);
|
|
|
|
|
|
|
|
|
|
return NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting)->ra_timeout;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-19 15:27:38 -06:00
|
|
|
/**
|
|
|
|
|
* nm_setting_ip6_config_get_mtu:
|
|
|
|
|
* @setting: the #NMSettingIP6Config
|
|
|
|
|
*
|
|
|
|
|
* Returns: The configured %NM_SETTING_IP6_CONFIG_MTU value for the maximum
|
|
|
|
|
* transmission unit.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.40
|
|
|
|
|
**/
|
|
|
|
|
guint32
|
|
|
|
|
nm_setting_ip6_config_get_mtu(NMSettingIP6Config *setting)
|
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail(NM_IS_SETTING_IP6_CONFIG(setting), 0);
|
|
|
|
|
|
|
|
|
|
return NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting)->mtu;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-24 08:53:33 -04:00
|
|
|
static gboolean
|
2014-10-21 22:30:31 -04:00
|
|
|
verify(NMSetting *setting, NMConnection *connection, GError **error)
|
2014-07-24 08:53:33 -04:00
|
|
|
{
|
2015-09-08 20:22:17 +02:00
|
|
|
NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting);
|
2021-11-09 13:28:54 +01:00
|
|
|
NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG(setting);
|
2014-10-20 21:30:56 -04:00
|
|
|
NMSettingVerifyResult ret;
|
2021-11-09 13:28:54 +01:00
|
|
|
const char *method;
|
2016-04-30 16:48:02 +02:00
|
|
|
gboolean token_needs_normalization = FALSE;
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2014-10-20 21:30:56 -04:00
|
|
|
ret = NM_SETTING_CLASS(nm_setting_ip6_config_parent_class)->verify(setting, connection, error);
|
|
|
|
|
if (ret != NM_SETTING_VERIFY_SUCCESS)
|
|
|
|
|
return ret;
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2014-10-19 17:30:10 -04:00
|
|
|
method = nm_setting_ip_config_get_method(s_ip);
|
|
|
|
|
/* Base class already checked that it exists */
|
|
|
|
|
g_assert(method);
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2019-04-26 13:25:21 +02:00
|
|
|
if (nm_streq(method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
|
2014-10-19 17:30:10 -04:00
|
|
|
if (nm_setting_ip_config_get_num_addresses(s_ip) == 0) {
|
2014-07-24 08:53:33 -04:00
|
|
|
g_set_error(error,
|
libnm-core: merge NMSetting*Error into NMConnectionError
Each setting type was defining its own error type, but most of them
had exactly the same three errors ("unknown", "missing property", and
"invalid property"), and none of the other values was of much use
programmatically anyway.
So, this commit merges NMSettingError, NMSettingAdslError, etc, all
into NMConnectionError. (The reason for merging into NMConnectionError
rather than NMSettingError is that we also already have
"NMSettingsError", for errors related to the settings service, so
"NMConnectionError" is a less-confusable name for settings/connection
errors than "NMSettingError".)
Also, make sure that all of the affected error messages are localized,
and (where appropriate) prefix them with the relevant property name.
Renamed error codes:
NM_SETTING_ERROR_PROPERTY_NOT_FOUND -> NM_CONNECTION_ERROR_PROPERTY_NOT_FOUND
NM_SETTING_ERROR_PROPERTY_NOT_SECRET -> NM_CONNECTION_ERROR_PROPERTY_NOT_SECRET
Remapped error codes:
NM_SETTING_*_ERROR_MISSING_PROPERTY -> NM_CONNECTION_ERROR_MISSING_PROPERTY
NM_SETTING_*_ERROR_INVALID_PROPERTY -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_INVALID_SETTING
NM_SETTING_BOND_ERROR_INVALID_OPTION -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_BOND_ERROR_MISSING_OPTION -> NM_CONNECTION_ERROR_MISSING_PROPERTY
NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING
NM_SETTING_CONNECTION_ERROR_SLAVE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING
NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_VLAN_ERROR_INVALID_PARENT -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING -> NM_CONNECTION_ERROR_MISSING_SETTING
NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME -> NM_CONNECTION_ERROR_MISSING_PROPERTY
NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND -> NM_CONNECTION_ERROR_MISSING_PROPERTY
Dropped error codes (were previously defined but unused):
NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING
NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED
NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING
NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED
NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING
NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING
NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING
2014-10-20 13:52:23 -04:00
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_MISSING_PROPERTY,
|
2014-07-24 08:53:33 -04:00
|
|
|
_("this property cannot be empty for '%s=%s'"),
|
2014-10-19 17:30:10 -04:00
|
|
|
NM_SETTING_IP_CONFIG_METHOD,
|
|
|
|
|
method);
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP_CONFIG_ADDRESSES);
|
2014-07-24 08:53:33 -04:00
|
|
|
return FALSE;
|
|
|
|
|
}
|
2019-04-26 13:25:21 +02:00
|
|
|
} else if (NM_IN_STRSET(method,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_METHOD_SHARED,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_METHOD_DISABLED)) {
|
|
|
|
|
/* Shared allows IP addresses and DNS; other methods do not */
|
|
|
|
|
if (!nm_streq(method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
|
2016-11-01 13:43:01 +01:00
|
|
|
if (nm_setting_ip_config_get_num_dns(s_ip) > 0) {
|
|
|
|
|
g_set_error(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("this property is not allowed for '%s=%s'"),
|
|
|
|
|
NM_SETTING_IP_CONFIG_METHOD,
|
|
|
|
|
method);
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP_CONFIG_DNS);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2016-11-01 13:43:01 +01:00
|
|
|
if (nm_setting_ip_config_get_num_dns_searches(s_ip) > 0) {
|
|
|
|
|
g_set_error(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("this property is not allowed for '%s=%s'"),
|
|
|
|
|
NM_SETTING_IP_CONFIG_METHOD,
|
|
|
|
|
method);
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP_CONFIG_DNS_SEARCH);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2016-11-01 13:43:01 +01:00
|
|
|
if (nm_setting_ip_config_get_num_addresses(s_ip) > 0) {
|
|
|
|
|
g_set_error(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("this property is not allowed for '%s=%s'"),
|
|
|
|
|
NM_SETTING_IP_CONFIG_METHOD,
|
|
|
|
|
method);
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP_CONFIG_ADDRESSES);
|
|
|
|
|
return FALSE;
|
2014-07-24 08:53:33 -04:00
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
}
|
2019-04-26 13:25:21 +02:00
|
|
|
} else if (NM_IN_STRSET(method,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_METHOD_AUTO,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_METHOD_DHCP)) {
|
2014-07-24 08:53:33 -04:00
|
|
|
/* nothing to do */
|
|
|
|
|
} else {
|
|
|
|
|
g_set_error_literal(error,
|
libnm-core: merge NMSetting*Error into NMConnectionError
Each setting type was defining its own error type, but most of them
had exactly the same three errors ("unknown", "missing property", and
"invalid property"), and none of the other values was of much use
programmatically anyway.
So, this commit merges NMSettingError, NMSettingAdslError, etc, all
into NMConnectionError. (The reason for merging into NMConnectionError
rather than NMSettingError is that we also already have
"NMSettingsError", for errors related to the settings service, so
"NMConnectionError" is a less-confusable name for settings/connection
errors than "NMSettingError".)
Also, make sure that all of the affected error messages are localized,
and (where appropriate) prefix them with the relevant property name.
Renamed error codes:
NM_SETTING_ERROR_PROPERTY_NOT_FOUND -> NM_CONNECTION_ERROR_PROPERTY_NOT_FOUND
NM_SETTING_ERROR_PROPERTY_NOT_SECRET -> NM_CONNECTION_ERROR_PROPERTY_NOT_SECRET
Remapped error codes:
NM_SETTING_*_ERROR_MISSING_PROPERTY -> NM_CONNECTION_ERROR_MISSING_PROPERTY
NM_SETTING_*_ERROR_INVALID_PROPERTY -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_INVALID_SETTING
NM_SETTING_BOND_ERROR_INVALID_OPTION -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_BOND_ERROR_MISSING_OPTION -> NM_CONNECTION_ERROR_MISSING_PROPERTY
NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING
NM_SETTING_CONNECTION_ERROR_SLAVE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING
NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_VLAN_ERROR_INVALID_PARENT -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING -> NM_CONNECTION_ERROR_MISSING_SETTING
NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME -> NM_CONNECTION_ERROR_MISSING_PROPERTY
NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP -> NM_CONNECTION_ERROR_INVALID_PROPERTY
NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND -> NM_CONNECTION_ERROR_MISSING_PROPERTY
Dropped error codes (were previously defined but unused):
NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING
NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED
NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING
NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED
NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING
NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING
NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING
2014-10-20 13:52:23 -04:00
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
2014-07-24 08:53:33 -04:00
|
|
|
_("property is invalid"));
|
2014-10-19 17:30:10 -04:00
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP_CONFIG_METHOD);
|
2014-07-24 08:53:33 -04:00
|
|
|
return FALSE;
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2015-09-08 20:22:17 +02:00
|
|
|
if (!NM_IN_SET(priv->addr_gen_mode,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64,
|
all: make "ipv6.addr-gen-mode" configurable by global default
It can be useful to choose a different "ipv6.addr-gen-mode". And it can be
useful to override the default for a set of profiles.
For example, in cloud or in a data center, stable-privacy might not be
the best choice. Add a mechanism to override the default via global defaults
in NetworkManager.conf:
# /etc/NetworkManager/conf.d/90-ipv6-addr-gen-mode-override.conf
[connection-90-ipv6-addr-gen-mode-override]
match-device=type:ethernet
ipv6.addr-gen-mode=0
"ipv6.addr-gen-mode" is a special property, because its default depends on
the component that configures the profile.
- when read from disk (keyfile and ifcfg-rh), a missing addr-gen-mode
key means to default to "eui64".
- when configured via D-Bus, a missing addr-gen-mode property means to
default to "stable-privacy".
- libnm's ip6-config::addr-gen-mode property defaults to
"stable-privacy".
- when some tool creates a profile, they either can explicitly
set the mode, or they get the default of the underlying mechanisms
above.
- nm-initrd-generator explicitly sets "eui64" for profiles it creates.
- nmcli doesn' explicitly set it, but inherits the default form
libnm's ip6-config::addr-gen-mode.
- when NM creates a auto-default-connection for ethernet ("Wired connection 1"),
it inherits the default from libnm's ip6-config::addr-gen-mode.
Global connection defaults only take effect when the per-profile
value is set to a special default/unset value. To account for the
different cases above, we add two such special values: "default" and
"default-or-eui64". That's something we didn't do before, but it seams
useful and easy to understand.
Also, this neatly expresses the current behaviors we already have. E.g.
if you don't specify the "addr-gen-mode" in a keyfile, "default-or-eui64"
is a pretty clear thing.
Note that usually we cannot change default values, in particular not for
libnm's properties. That is because we don't serialize the default
values to D-Bus/keyfile, so if we change the default, we change
behavior. Here we change from "stable-privacy" to "default" and
from "eui64" to "default-or-eui64". That means, the user only experiences
a change in behavior, if they have a ".conf" file that overrides the default.
https://bugzilla.redhat.com/show_bug.cgi?id=1743161
https://bugzilla.redhat.com/show_bug.cgi?id=2082682
See-also: https://github.com/coreos/fedora-coreos-tracker/issues/907
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1213
2022-05-06 16:57:51 +02:00
|
|
|
NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT_OR_EUI64,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT)) {
|
2015-09-08 20:22:17 +02:00
|
|
|
g_set_error_literal(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("property is invalid"));
|
2017-03-28 19:04:26 +02:00
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE);
|
2015-09-08 20:22:17 +02:00
|
|
|
return FALSE;
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2016-04-30 16:48:02 +02:00
|
|
|
if (priv->token) {
|
|
|
|
|
if (priv->addr_gen_mode == NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64) {
|
|
|
|
|
struct in6_addr i6_token;
|
glib-aux: rename IP address related helpers from "nm-inet-utils.h"
- name things related to `in_addr_t`, `struct in6_addr`, `NMIPAddr` as
`nm_ip4_addr_*()`, `nm_ip6_addr_*()`, `nm_ip_addr_*()`, respectively.
- we have a wrapper `nm_inet_ntop()` for `inet_ntop()`. This name
of our wrapper is chosen to be familiar with the libc underlying
function. With this, also name functions that are about string
representations of addresses `nm_inet_*()`, `nm_inet4_*()`,
`nm_inet6_*()`. For example, `nm_inet_parse_str()`,
`nm_inet_is_normalized()`.
<<<<
R() {
git grep -l "$1" | xargs sed -i "s/\<$1\>/$2/g"
}
R NM_CMP_DIRECT_IN4ADDR_SAME_PREFIX NM_CMP_DIRECT_IP4_ADDR_SAME_PREFIX
R NM_CMP_DIRECT_IN6ADDR_SAME_PREFIX NM_CMP_DIRECT_IP6_ADDR_SAME_PREFIX
R NM_UTILS_INET_ADDRSTRLEN NM_INET_ADDRSTRLEN
R _nm_utils_inet4_ntop nm_inet4_ntop
R _nm_utils_inet6_ntop nm_inet6_ntop
R _nm_utils_ip4_get_default_prefix nm_ip4_addr_get_default_prefix
R _nm_utils_ip4_get_default_prefix0 nm_ip4_addr_get_default_prefix0
R _nm_utils_ip4_netmask_to_prefix nm_ip4_addr_netmask_to_prefix
R _nm_utils_ip4_prefix_to_netmask nm_ip4_addr_netmask_from_prefix
R nm_utils_inet4_ntop_dup nm_inet4_ntop_dup
R nm_utils_inet6_ntop_dup nm_inet6_ntop_dup
R nm_utils_inet_ntop nm_inet_ntop
R nm_utils_inet_ntop_dup nm_inet_ntop_dup
R nm_utils_ip4_address_clear_host_address nm_ip4_addr_clear_host_address
R nm_utils_ip4_address_is_link_local nm_ip4_addr_is_link_local
R nm_utils_ip4_address_is_loopback nm_ip4_addr_is_loopback
R nm_utils_ip4_address_is_zeronet nm_ip4_addr_is_zeronet
R nm_utils_ip4_address_same_prefix nm_ip4_addr_same_prefix
R nm_utils_ip4_address_same_prefix_cmp nm_ip4_addr_same_prefix_cmp
R nm_utils_ip6_address_clear_host_address nm_ip6_addr_clear_host_address
R nm_utils_ip6_address_same_prefix nm_ip6_addr_same_prefix
R nm_utils_ip6_address_same_prefix_cmp nm_ip6_addr_same_prefix_cmp
R nm_utils_ip6_is_ula nm_ip6_addr_is_ula
R nm_utils_ip_address_same_prefix nm_ip_addr_same_prefix
R nm_utils_ip_address_same_prefix_cmp nm_ip_addr_same_prefix_cmp
R nm_utils_ip_is_site_local nm_ip_addr_is_site_local
R nm_utils_ipaddr_is_normalized nm_inet_is_normalized
R nm_utils_ipaddr_is_valid nm_inet_is_valid
R nm_utils_ipx_address_clear_host_address nm_ip_addr_clear_host_address
R nm_utils_parse_inaddr nm_inet_parse_str
R nm_utils_parse_inaddr_bin nm_inet_parse_bin
R nm_utils_parse_inaddr_bin_full nm_inet_parse_bin_full
R nm_utils_parse_inaddr_prefix nm_inet_parse_with_prefix_str
R nm_utils_parse_inaddr_prefix_bin nm_inet_parse_with_prefix_bin
R test_nm_utils_ip6_address_same_prefix test_nm_ip_addr_same_prefix
./contrib/scripts/nm-code-format.sh -F
2022-08-19 13:15:20 +02:00
|
|
|
char s_token[NM_INET_ADDRSTRLEN];
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2016-04-30 16:48:02 +02:00
|
|
|
if (inet_pton(AF_INET6, priv->token, &i6_token) != 1
|
|
|
|
|
|| !_nm_utils_inet6_is_token(&i6_token)) {
|
|
|
|
|
g_set_error_literal(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("value is not a valid token"));
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_TOKEN);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
glib-aux: rename IP address related helpers from "nm-inet-utils.h"
- name things related to `in_addr_t`, `struct in6_addr`, `NMIPAddr` as
`nm_ip4_addr_*()`, `nm_ip6_addr_*()`, `nm_ip_addr_*()`, respectively.
- we have a wrapper `nm_inet_ntop()` for `inet_ntop()`. This name
of our wrapper is chosen to be familiar with the libc underlying
function. With this, also name functions that are about string
representations of addresses `nm_inet_*()`, `nm_inet4_*()`,
`nm_inet6_*()`. For example, `nm_inet_parse_str()`,
`nm_inet_is_normalized()`.
<<<<
R() {
git grep -l "$1" | xargs sed -i "s/\<$1\>/$2/g"
}
R NM_CMP_DIRECT_IN4ADDR_SAME_PREFIX NM_CMP_DIRECT_IP4_ADDR_SAME_PREFIX
R NM_CMP_DIRECT_IN6ADDR_SAME_PREFIX NM_CMP_DIRECT_IP6_ADDR_SAME_PREFIX
R NM_UTILS_INET_ADDRSTRLEN NM_INET_ADDRSTRLEN
R _nm_utils_inet4_ntop nm_inet4_ntop
R _nm_utils_inet6_ntop nm_inet6_ntop
R _nm_utils_ip4_get_default_prefix nm_ip4_addr_get_default_prefix
R _nm_utils_ip4_get_default_prefix0 nm_ip4_addr_get_default_prefix0
R _nm_utils_ip4_netmask_to_prefix nm_ip4_addr_netmask_to_prefix
R _nm_utils_ip4_prefix_to_netmask nm_ip4_addr_netmask_from_prefix
R nm_utils_inet4_ntop_dup nm_inet4_ntop_dup
R nm_utils_inet6_ntop_dup nm_inet6_ntop_dup
R nm_utils_inet_ntop nm_inet_ntop
R nm_utils_inet_ntop_dup nm_inet_ntop_dup
R nm_utils_ip4_address_clear_host_address nm_ip4_addr_clear_host_address
R nm_utils_ip4_address_is_link_local nm_ip4_addr_is_link_local
R nm_utils_ip4_address_is_loopback nm_ip4_addr_is_loopback
R nm_utils_ip4_address_is_zeronet nm_ip4_addr_is_zeronet
R nm_utils_ip4_address_same_prefix nm_ip4_addr_same_prefix
R nm_utils_ip4_address_same_prefix_cmp nm_ip4_addr_same_prefix_cmp
R nm_utils_ip6_address_clear_host_address nm_ip6_addr_clear_host_address
R nm_utils_ip6_address_same_prefix nm_ip6_addr_same_prefix
R nm_utils_ip6_address_same_prefix_cmp nm_ip6_addr_same_prefix_cmp
R nm_utils_ip6_is_ula nm_ip6_addr_is_ula
R nm_utils_ip_address_same_prefix nm_ip_addr_same_prefix
R nm_utils_ip_address_same_prefix_cmp nm_ip_addr_same_prefix_cmp
R nm_utils_ip_is_site_local nm_ip_addr_is_site_local
R nm_utils_ipaddr_is_normalized nm_inet_is_normalized
R nm_utils_ipaddr_is_valid nm_inet_is_valid
R nm_utils_ipx_address_clear_host_address nm_ip_addr_clear_host_address
R nm_utils_parse_inaddr nm_inet_parse_str
R nm_utils_parse_inaddr_bin nm_inet_parse_bin
R nm_utils_parse_inaddr_bin_full nm_inet_parse_bin_full
R nm_utils_parse_inaddr_prefix nm_inet_parse_with_prefix_str
R nm_utils_parse_inaddr_prefix_bin nm_inet_parse_with_prefix_bin
R test_nm_utils_ip6_address_same_prefix test_nm_ip_addr_same_prefix
./contrib/scripts/nm-code-format.sh -F
2022-08-19 13:15:20 +02:00
|
|
|
if (g_strcmp0(priv->token, nm_inet6_ntop(&i6_token, s_token)))
|
2016-04-30 16:48:02 +02:00
|
|
|
token_needs_normalization = TRUE;
|
|
|
|
|
} else {
|
|
|
|
|
g_set_error_literal(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("only makes sense with EUI64 address generation mode"));
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_TOKEN);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2018-03-06 16:10:01 +01:00
|
|
|
if (priv->dhcp_duid) {
|
|
|
|
|
if (!_nm_utils_dhcp_duid_valid(priv->dhcp_duid, NULL)) {
|
|
|
|
|
g_set_error_literal(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("invalid DUID"));
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_DHCP_DUID);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2022-10-24 17:08:02 +02:00
|
|
|
if (priv->dhcp_pd_hint) {
|
|
|
|
|
int prefix;
|
|
|
|
|
|
|
|
|
|
if (!nm_inet_parse_with_prefix_bin(AF_INET6, priv->dhcp_pd_hint, NULL, NULL, &prefix)
|
|
|
|
|
|| prefix < 1 || prefix > 128) {
|
|
|
|
|
g_set_error_literal(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("must be a valid IPv6 address with prefix"));
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_DHCP_PD_HINT);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-30 16:48:02 +02:00
|
|
|
/* Failures from here on, are NORMALIZABLE_ERROR... */
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2016-04-30 16:48:02 +02:00
|
|
|
if (token_needs_normalization) {
|
|
|
|
|
g_set_error_literal(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
|
|
|
|
_("token is not in canonical form"));
|
|
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_TOKEN);
|
|
|
|
|
return NM_SETTING_VERIFY_NORMALIZABLE_ERROR;
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2016-07-01 17:05:42 +02:00
|
|
|
/* Failures from here on are NORMALIZABLE... */
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2019-04-26 13:25:21 +02:00
|
|
|
if (NM_IN_STRSET(method,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_METHOD_IGNORE,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_METHOD_DISABLED)
|
2016-07-01 17:05:42 +02:00
|
|
|
&& !nm_setting_ip_config_get_may_fail(s_ip)) {
|
|
|
|
|
g_set_error_literal(error,
|
|
|
|
|
NM_CONNECTION_ERROR,
|
|
|
|
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
2019-04-26 13:25:21 +02:00
|
|
|
_("property should be TRUE when method is set to ignore or disabled"));
|
2016-07-01 17:05:42 +02:00
|
|
|
g_prefix_error(error,
|
|
|
|
|
"%s.%s: ",
|
|
|
|
|
NM_SETTING_IP6_CONFIG_SETTING_NAME,
|
|
|
|
|
NM_SETTING_IP_CONFIG_MAY_FAIL);
|
|
|
|
|
return NM_SETTING_VERIFY_NORMALIZABLE;
|
|
|
|
|
}
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2014-07-24 08:53:33 -04:00
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-16 10:09:48 -04:00
|
|
|
static GVariant *
|
libnm: use macros function arguments for NMSettInfoPropertType
These functions tend to have many arguments. They are also quite som
boilerplate to implement the hundereds of properties we have, while
we want that properties have common behaviors and similarities.
Instead of repeatedly spelling out the function arguments, use a macro.
Advantages:
- the usage of a _NM_SETT_INFO_PROP_*_FCN_ARGS macro signals that this
is an implementation of a property. You can now grep for these macros
to find all implementation. That was previously rather imprecise, you
could only `git grep '\.to_dbus_fcn'` to find the uses, but not the
implementations.
As the goal is to keep properties "similar", there is a desire to
reduce the number of similar implementations and to find them.
- changing the arguments now no longer will require you to go through
all implementations. At least not, if you merely add an argument that
has a reasonable default behavior and does not require explicit
handling by most implementation.
- it's convenient to be able to patch the argument list to let the
compiler help to reason about something. For example, the
"connection_dict" argument to from_dbus_fcn() is usually unused.
If you'd like to find who uses it, rename the parameter, and
review the (few) compiler errors.
- it does save 573 LOC of boilerplate with no actual logic or useful
information. I argue, that this simplifies the code and review, by
increasing the relative amount of actually meaningful code.
Disadvantages:
- the user no longer directly sees the argument list. They would need
cscope/ctags or an IDE to jump to the macro definition and conveniently
see all arguments.
Also use _nm_nil, so that clang-format interprets this as a function
parameter list. Otherwise, it formats the function differently.
2021-07-26 23:45:31 +02:00
|
|
|
ip6_dns_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
2014-08-16 10:09:48 -04:00
|
|
|
{
|
2021-06-29 21:53:55 +02:00
|
|
|
GPtrArray *dns;
|
|
|
|
|
|
|
|
|
|
dns = _nm_setting_ip_config_get_dns_array(NM_SETTING_IP_CONFIG(setting));
|
|
|
|
|
if (nm_g_ptr_array_len(dns) == 0)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
2022-10-24 18:36:29 +02:00
|
|
|
return nm_utils_dns_to_variant(AF_INET6, (const char *const *) dns->pdata, dns->len);
|
2014-08-16 10:09:48 -04:00
|
|
|
}
|
|
|
|
|
|
libnm: add "dns-data" replacement for "ipv[46].dns" properties on D-Bus
On D-Bus, the properties "ipv[46].dns" are of type "au" and "aay",
respectively.
Btw, in particular "au" is bad, because we put there a big-endian
number. There is no D-Bus type to represent big endian numbers, so "u"
is bad because it can cause endianess problem when trying to remote
the D-Bus communication to another host (without explicitly
understanding which "u" properties need to swap for endinness).
Anyway. The plain addresses are not enough. We soon will also support
the DNS-over-TLS server name, or maybe a DoT port number. The previous
property was not extensible, so deprecate it and replace it by
"dns-data".
This one is just a list of strings. That is unlike "address-data" or
"route-data", which do a similar thing but are "a{sv}" dictionaries.
Here a string is supposed to be sufficient also for the future. Also,
because in nmcli and keyfile will will simply have a string format for
representing the extra data, not a structure (unlike for routes or
addresses).
2022-10-21 14:50:32 +02:00
|
|
|
static gboolean
|
|
|
|
|
ip6_dns_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
2014-08-16 10:09:48 -04:00
|
|
|
{
|
libnm: add "dns-data" replacement for "ipv[46].dns" properties on D-Bus
On D-Bus, the properties "ipv[46].dns" are of type "au" and "aay",
respectively.
Btw, in particular "au" is bad, because we put there a big-endian
number. There is no D-Bus type to represent big endian numbers, so "u"
is bad because it can cause endianess problem when trying to remote
the D-Bus communication to another host (without explicitly
understanding which "u" properties need to swap for endinness).
Anyway. The plain addresses are not enough. We soon will also support
the DNS-over-TLS server name, or maybe a DoT port number. The previous
property was not extensible, so deprecate it and replace it by
"dns-data".
This one is just a list of strings. That is unlike "address-data" or
"route-data", which do a similar thing but are "a{sv}" dictionaries.
Here a string is supposed to be sufficient also for the future. Also,
because in nmcli and keyfile will will simply have a string format for
representing the extra data, not a structure (unlike for routes or
addresses).
2022-10-21 14:50:32 +02:00
|
|
|
gs_strfreev char **strv = NULL;
|
|
|
|
|
|
|
|
|
|
if (!_nm_setting_use_legacy_property(setting, connection_dict, "dns", "dns-data")) {
|
|
|
|
|
*out_is_modified = FALSE;
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
strv = nm_utils_ip6_dns_from_variant(value);
|
|
|
|
|
g_object_set(setting, NM_SETTING_IP_CONFIG_DNS, strv, NULL);
|
|
|
|
|
return TRUE;
|
2014-08-16 10:09:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GVariant *
|
2022-10-21 14:50:27 +02:00
|
|
|
ip6_addresses_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
2014-08-16 10:09:48 -04:00
|
|
|
{
|
2019-04-24 17:41:32 +02:00
|
|
|
gs_unref_ptrarray GPtrArray *addrs = NULL;
|
2021-11-09 13:28:54 +01:00
|
|
|
const char *gateway;
|
2014-10-20 21:30:56 -04:00
|
|
|
|
2019-04-24 17:41:32 +02:00
|
|
|
g_object_get(setting, NM_SETTING_IP_CONFIG_ADDRESSES, &addrs, NULL);
|
2014-10-20 21:30:56 -04:00
|
|
|
gateway = nm_setting_ip_config_get_gateway(NM_SETTING_IP_CONFIG(setting));
|
2019-04-24 17:41:32 +02:00
|
|
|
return nm_utils_ip6_addresses_to_variant(addrs, gateway);
|
2014-08-16 10:09:48 -04:00
|
|
|
}
|
|
|
|
|
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
static gboolean
|
2022-10-21 14:50:27 +02:00
|
|
|
ip6_addresses_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
2014-08-16 10:09:48 -04:00
|
|
|
{
|
2022-10-21 14:55:15 +02:00
|
|
|
gs_unref_ptrarray GPtrArray *addrs = NULL;
|
|
|
|
|
gs_free char *gateway = NULL;
|
2014-10-20 21:30:56 -04:00
|
|
|
|
2021-07-27 10:27:44 +02:00
|
|
|
if (!_nm_setting_use_legacy_property(setting, connection_dict, "addresses", "address-data")) {
|
|
|
|
|
*out_is_modified = FALSE;
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
return TRUE;
|
2021-07-27 10:27:44 +02:00
|
|
|
}
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
|
|
|
|
addrs = nm_utils_ip6_addresses_from_variant(value, &gateway);
|
2014-10-20 21:30:56 -04:00
|
|
|
|
2014-11-14 11:46:19 -05:00
|
|
|
g_object_set(setting,
|
|
|
|
|
NM_SETTING_IP_CONFIG_ADDRESSES,
|
|
|
|
|
addrs,
|
|
|
|
|
NM_SETTING_IP_CONFIG_GATEWAY,
|
|
|
|
|
gateway,
|
|
|
|
|
NULL);
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
return TRUE;
|
2014-08-16 10:09:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GVariant *
|
2022-10-21 14:50:27 +02:00
|
|
|
ip6_address_data_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
{
|
2019-01-02 15:54:18 +01:00
|
|
|
gs_unref_ptrarray GPtrArray *addrs = NULL;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
2021-03-25 16:39:35 +01:00
|
|
|
if (!_nm_connection_serialize_non_secret(flags))
|
2019-01-02 15:54:18 +01:00
|
|
|
return NULL;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
2019-01-02 15:54:18 +01:00
|
|
|
g_object_get(setting, NM_SETTING_IP_CONFIG_ADDRESSES, &addrs, NULL);
|
|
|
|
|
return nm_utils_ip_addresses_to_variant(addrs);
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
}
|
|
|
|
|
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
static gboolean
|
2022-10-21 14:50:27 +02:00
|
|
|
ip6_address_data_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
{
|
2022-10-21 14:55:15 +02:00
|
|
|
gs_unref_ptrarray GPtrArray *addrs = NULL;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
2014-11-14 11:46:19 -05:00
|
|
|
/* Ignore 'address-data' if we're going to process 'addresses' */
|
2021-07-27 10:27:44 +02:00
|
|
|
if (_nm_setting_use_legacy_property(setting, connection_dict, "addresses", "address-data")) {
|
|
|
|
|
*out_is_modified = FALSE;
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
return TRUE;
|
2021-07-27 10:27:44 +02:00
|
|
|
}
|
2014-11-14 11:46:19 -05:00
|
|
|
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
addrs = nm_utils_ip_addresses_from_variant(value, AF_INET6);
|
|
|
|
|
g_object_set(setting, NM_SETTING_IP_CONFIG_ADDRESSES, addrs, NULL);
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
return TRUE;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GVariant *
|
2022-10-21 14:50:27 +02:00
|
|
|
ip6_routes_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
{
|
2019-04-24 17:41:32 +02:00
|
|
|
gs_unref_ptrarray GPtrArray *routes = NULL;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
2019-04-24 17:41:32 +02:00
|
|
|
g_object_get(setting, NM_SETTING_IP_CONFIG_ROUTES, &routes, NULL);
|
|
|
|
|
return nm_utils_ip6_routes_to_variant(routes);
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
}
|
|
|
|
|
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
static gboolean
|
2022-10-21 14:50:27 +02:00
|
|
|
ip6_routes_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
{
|
2022-10-21 14:55:15 +02:00
|
|
|
gs_unref_ptrarray GPtrArray *routes = NULL;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
2021-07-27 10:27:44 +02:00
|
|
|
if (!_nm_setting_use_legacy_property(setting, connection_dict, "routes", "route-data")) {
|
|
|
|
|
*out_is_modified = FALSE;
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
return TRUE;
|
2021-07-27 10:27:44 +02:00
|
|
|
}
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
|
|
|
|
routes = nm_utils_ip6_routes_from_variant(value);
|
2021-06-29 23:51:46 +02:00
|
|
|
g_object_set(setting, property_info->name, routes, NULL);
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
return TRUE;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GVariant *
|
2022-10-21 14:50:27 +02:00
|
|
|
ip6_route_data_to_dbus(_NM_SETT_INFO_PROP_TO_DBUS_FCN_ARGS _nm_nil)
|
2014-08-16 10:09:48 -04:00
|
|
|
{
|
2019-01-02 15:54:18 +01:00
|
|
|
gs_unref_ptrarray GPtrArray *routes = NULL;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
2021-03-25 16:39:35 +01:00
|
|
|
if (!_nm_connection_serialize_non_secret(flags))
|
2019-01-02 15:54:18 +01:00
|
|
|
return NULL;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
2019-01-02 15:54:18 +01:00
|
|
|
g_object_get(setting, NM_SETTING_IP_CONFIG_ROUTES, &routes, NULL);
|
|
|
|
|
return nm_utils_ip_routes_to_variant(routes);
|
2014-08-16 10:09:48 -04:00
|
|
|
}
|
|
|
|
|
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
static gboolean
|
2022-10-21 14:50:27 +02:00
|
|
|
ip6_route_data_from_dbus(_NM_SETT_INFO_PROP_FROM_DBUS_FCN_ARGS _nm_nil)
|
2014-08-16 10:09:48 -04:00
|
|
|
{
|
2022-10-21 14:55:15 +02:00
|
|
|
gs_unref_ptrarray GPtrArray *routes = NULL;
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
|
2014-11-14 11:46:19 -05:00
|
|
|
/* Ignore 'route-data' if we're going to process 'routes' */
|
2021-07-27 10:27:44 +02:00
|
|
|
if (_nm_setting_use_legacy_property(setting, connection_dict, "routes", "route-data")) {
|
|
|
|
|
*out_is_modified = FALSE;
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
return TRUE;
|
2021-07-27 10:27:44 +02:00
|
|
|
}
|
2014-11-14 11:46:19 -05:00
|
|
|
|
libnm-core, libnm, core: add AddressData and RouteData properties
Add AddressData and RouteData properties to NMSettingIPConfig and
NMIP[46]Config. These are like the existing "addresses" and "routes"
properties, but using strings and containing additional attributes,
like NMIPAddress and NMIPRoute.
This only affects the D-Bus representations; there are no API changes
to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the
additional information is just added to the existing 'addresses' and
'routes' properties.
NMSettingIP4Config and NMSettingIP6Config now always generate both
old-style data ('addresses', 'address-labels', 'routes') and new-style
data ('address-data', 'gateway', 'route-data') when serializing to
D-Bus, for backward compatibility. When deserializing, they will fill
in the 'addresses' and 'routes' properties from the new-style data if
it is present (ignoring the old-style data), or from the old-style
data if the new-style isn't present.
The daemon-side NMIP4Config and NMIP6Config always emit changes for
both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The
libnm-side classes initially listen for changes on both properties,
but start ignoring the 'Addresses' and 'Routes' properties once they
know the daemon is also providing 'AddressData' and 'RouteData'.
2014-10-21 08:33:18 -04:00
|
|
|
routes = nm_utils_ip_routes_from_variant(value, AF_INET6);
|
|
|
|
|
g_object_set(setting, NM_SETTING_IP_CONFIG_ROUTES, routes, NULL);
|
libnm-core: allow strict and relaxed error behavior for _nm_setting_new_from_dbus()
In some situations, we want strict checking of errors, for example when
NetworkManager receives a new connection from a client, the connection
must make sense as a whole (and since NetworkManager service is backward
compatible to the clients and not the other way around, there is no
excuse for sending invalid data to the server).
In other situations, we want a best-effort behavior. Like when
NetworkManager sends a connection to its clients, those clients
want to extract as many properties as they understand, but in order
to be forward compatible against newer server versions, invalid
or unknown properties must be accepted.
Previously, a mixture of both was done. Some issues caused a failure
to create a new NMSetting, other invalid parts were just silently
ignored or triggered a g_warning() in glib.
Now allow for both. When doing strict-validation, be more strict and
reject all unknown properties and catch when the user sets an invalid
argument. On the other hand, allow for a best-effort mode that
effectively cannot fail and will return a new NMSetting instance.
For now, add NMSettingParseFlags so that the caller can choose the
old behavior, strict parsing, or best effort.
This patch doesn't have any externally visible change except that
no more g_warnings will be emitted.
2016-03-18 13:42:50 +01:00
|
|
|
return TRUE;
|
2014-08-16 10:09:48 -04:00
|
|
|
}
|
|
|
|
|
|
2022-10-24 17:08:02 +02:00
|
|
|
static gboolean
|
|
|
|
|
_set_string_fcn_dhcp_pd_hint(const NMSettInfoSetting *sett_info,
|
|
|
|
|
const NMSettInfoProperty *property_info,
|
|
|
|
|
NMSetting *setting,
|
|
|
|
|
const char *str)
|
|
|
|
|
{
|
|
|
|
|
NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting);
|
|
|
|
|
char buf[NM_INET_ADDRSTRLEN];
|
|
|
|
|
char bufp[NM_INET_ADDRSTRLEN + 16];
|
|
|
|
|
gs_free char *old = NULL;
|
|
|
|
|
NMIPAddr addr;
|
|
|
|
|
int prefix;
|
|
|
|
|
|
|
|
|
|
if (!str)
|
|
|
|
|
goto do_set;
|
|
|
|
|
|
|
|
|
|
if (!nm_inet_parse_with_prefix_bin(AF_INET6, str, NULL, &addr, &prefix)) {
|
|
|
|
|
/* address not valid, set as is */
|
|
|
|
|
goto do_set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* address valid, normalize */
|
|
|
|
|
nm_inet6_ntop(&addr.addr6, buf);
|
|
|
|
|
nm_sprintf_buf(bufp, "%s/%d", buf, prefix);
|
|
|
|
|
str = bufp;
|
|
|
|
|
|
|
|
|
|
do_set:
|
|
|
|
|
if (!nm_streq0(priv->dhcp_pd_hint, str)) {
|
|
|
|
|
old = priv->dhcp_pd_hint;
|
|
|
|
|
priv->dhcp_pd_hint = g_strdup(str);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-11 08:32:54 +01:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
nm_setting_ip6_config_init(NMSettingIP6Config *setting)
|
|
|
|
|
{
|
2019-12-12 11:52:11 +01:00
|
|
|
NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE(setting);
|
|
|
|
|
|
2021-06-28 18:14:04 +02:00
|
|
|
_nm_setting_ip_config_private_init(setting, &priv->parent);
|
2019-01-11 08:32:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* nm_setting_ip6_config_new:
|
|
|
|
|
*
|
|
|
|
|
* Creates a new #NMSettingIP6Config object with default values.
|
|
|
|
|
*
|
|
|
|
|
* Returns: (transfer full): the new empty #NMSettingIP6Config object
|
|
|
|
|
**/
|
|
|
|
|
NMSetting *
|
|
|
|
|
nm_setting_ip6_config_new(void)
|
|
|
|
|
{
|
2020-11-12 15:57:06 +01:00
|
|
|
return g_object_new(NM_TYPE_SETTING_IP6_CONFIG, NULL);
|
2019-01-11 08:32:54 +01:00
|
|
|
}
|
|
|
|
|
|
2014-07-24 08:53:33 -04:00
|
|
|
static void
|
libnm/trivial: cleanup variable names in settings' class-init functions
- Don't use @parent_class name. This local variable (and @object_class) is
the class instance up-cast to the pointer types of the parents. The point
here is not that it is the direct parent. The point is, that it's the
NMSettingClass type.
Also, it can only be used inconsistently, in face of NMSettingIP4Config,
who's parent type is NMSettingIPConfig. Clearly, inside
nm-setting-ip4-config.c we wouldn't want to use the "parent_class"
name. Consistently rename @parent_class to @setting_class.
- Also rename the pointer to the own class to @klass. "setting_class" is also the
wrong name for that, because the right name would be something like
"setting_6lowpan_class".
However, "klass" is preferred over the latter, because we commonly create new
GObject implementations by copying an existing one. Generic names like "klass"
and "self" inside a type implementation make that simpler.
- drop useless comments like
/* virtual functions */
/* Properties */
It's better to logically and visually structure the code, and avoid trival
remarks about that. They only end up being used inconsistently. If you
even need a stronger visual separator, then an 80 char /****/ line
should be preferred.
2018-07-28 10:43:21 +02:00
|
|
|
nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
2014-07-24 08:53:33 -04:00
|
|
|
{
|
2021-11-09 13:28:54 +01:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS(klass);
|
|
|
|
|
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
|
2021-06-28 18:14:04 +02:00
|
|
|
NMSettingIPConfigClass *setting_ip_config_class = NM_SETTING_IP_CONFIG_CLASS(klass);
|
2021-07-14 07:40:35 +02:00
|
|
|
GArray *properties_override = _nm_sett_info_property_override_create_array_ip_config(AF_INET6);
|
2014-07-24 08:53:33 -04:00
|
|
|
|
2022-01-05 16:12:09 +01:00
|
|
|
object_class->get_property = _nm_setting_property_get_property_direct;
|
|
|
|
|
object_class->set_property = _nm_setting_property_set_property_direct;
|
2014-07-24 08:53:33 -04:00
|
|
|
|
libnm: rework setting metadata for property handling
NMSetting internally already tracked a list of all proper GObject properties
and D-Bus-only properties.
Rework the tracking of the list, so that:
- instead of attaching the data to the GType of the setting via
g_type_set_qdata(), it is tracked in a static array indexed by
NMMetaSettingType. This allows to find the setting-data by simple
pointer arithmetic, instead of taking a look and iterating (like
g_type_set_qdata() does).
Note, that this is still thread safe, because the static table entry is
initialized in the class-init function with _nm_setting_class_commit().
And it only accessed by following a NMSettingClass instance, thus
the class constructor already ran (maybe not for all setting classes,
but for the particular one that we look up).
I think this makes initialization of the metadata simpler to
understand.
Previously, in a first phase each class would attach the metadata
to the GType as setting_property_overrides_quark(). Then during
nm_setting_class_ensure_properties() it would merge them and
set as setting_properties_quark(). Now, during the first phase,
we only incrementally build a properties_override GArray, which
we finally hand over during nm_setting_class_commit().
- sort the property infos by name and do binary search.
Also expose this meta data types as internal API in nm-setting-private.h.
While not accessed yet, it can prove beneficial, to have direct (internal)
access to these structures.
Also, rename NMSettingProperty to NMSettInfoProperty to use a distinct
naming scheme. We already have 40+ subclasses of NMSetting that are called
NMSetting*. Likewise, NMMetaSetting* is heavily used already. So, choose a
new, distinct name.
2018-07-28 15:26:03 +02:00
|
|
|
setting_class->verify = verify;
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
|
libnm: embed private structure in NMSetting and avoid g_type_class_add_private()
Historically, the NMSetting types were in public headers. Theoretically,
that allowed users to subtype our classes. However in practice that was
impossible because they lacked required access to internal functions to
fully create an NMSetting class outside of libnm. And it also was not
useful, because you simply cannot extend libnm by subtyping a libnm
class. And supporting such a use case would be hard and limit what we can
do in libnm.
Having GObject structs in public headers also require that we don't
change it's layout. The ABI of those structs must not change, if anybody
out there was actually subclassing our GObjects.
In libnm 1.34 (commit e46d484fae9e ('libnm: hide NMSetting types from
public headers')) we moved the structs from headers to internal.
This would have caused a compiler error if anybody was using those
struct definitions. However, we still didn't change the ABI/layout so
that we didn't break users who relied on it (for whatever reason).
It doesn't seem there were any affected user. We waited long enough.
Change internal ABI.
No longer use g_type_class_add_private(). Instead, embed the private
structs directly (_NM_GET_PRIVATE()) or indirectly
(_NM_GET_PRIVATE_PTR()) in the object.
The main benefit is for debugging in the debugger, where we can now
easily find the private data. Previously that was so cumbersome to be
effectively impossible.
It's also the fastest possible way, since NM_SETTING_*_GET_PRIVATE()
literally resolves to "&self->_priv" (plus static asserts and
nm_assert() for type checking).
_NM_GET_PRIVATE() also propagates constness and requires that the
argument is a compatible pointer type (at compile time).
Note that g_type_class_add_private() is also deprecated in glib 2.58 and
replaced by G_ADD_PRIVATE(). For one, we still don't rely on 2.58. Also,
G_ADD_PRIVATE() is a worse solution as it supports a usecase that we
don't care for (public structs in headers). _NM_GET_PRIVATE() is still
faster, works with older glib and most importantly: is better for
debugging as you can find the private data from an object pointer.
For NMSettingIPConfig this is rather awkward, because all direct
properties require a common "klass->private_offset". This was however
the case before this change. Nothing new here. And if you ever touch
this and do something wrong, many unit tests will fail. It's almost
impossible to get wrong, albeit it can be confusing to understand.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1773
2023-10-24 19:05:50 +02:00
|
|
|
setting_ip_config_class->private_offset = G_STRUCT_OFFSET(NMSettingIP6Config, _priv);
|
2022-09-26 21:50:42 +02:00
|
|
|
setting_ip_config_class->is_ipv4 = FALSE;
|
|
|
|
|
setting_ip_config_class->addr_family = AF_INET6;
|
2021-06-28 18:14:04 +02:00
|
|
|
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: method
|
2019-04-26 13:25:21 +02:00
|
|
|
* variable: IPV6INIT, IPV6FORWARDING, IPV6_AUTOCONF, DHCPV6C, IPV6_DISABLED
|
2022-10-04 11:20:48 +02:00
|
|
|
* default: IPV6INIT=yes; IPV6FORWARDING=no; IPV6_AUTOCONF=!IPV6FORWARDING, DHCPV6=no
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* description: Method used for IPv6 protocol configuration.
|
2019-04-26 13:25:21 +02:00
|
|
|
* ignore ~ IPV6INIT=no; auto ~ IPV6_AUTOCONF=yes; dhcp ~ IPV6_AUTOCONF=no and DHCPV6C=yes;
|
|
|
|
|
* disabled ~ IPV6_DISABLED=yes
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ---keyfile---
|
|
|
|
|
* property: dns
|
|
|
|
|
* format: list of DNS IP addresses
|
|
|
|
|
* description: List of DNS servers.
|
|
|
|
|
* example: dns=2001:4860:4860::8888;2001:4860:4860::8844;
|
|
|
|
|
* ---end---
|
2022-08-29 15:05:39 +02:00
|
|
|
*/
|
|
|
|
|
/* ---ifcfg-rh---
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* property: dns
|
|
|
|
|
* variable: DNS1, DNS2, ...
|
2022-10-04 11:20:48 +02:00
|
|
|
* format: string
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* description: List of DNS servers. NetworkManager uses the variables both
|
|
|
|
|
* for IPv4 and IPv6.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: dns-search
|
2018-05-28 18:13:42 +02:00
|
|
|
* variable: IPV6_DOMAIN(+)
|
2022-10-04 11:20:48 +02:00
|
|
|
* format: string (space-separated domains)
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* description: List of DNS search domains.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ---keyfile---
|
|
|
|
|
* property: addresses
|
|
|
|
|
* variable: address1, address2, ...
|
2014-11-18 20:19:11 +01:00
|
|
|
* format: address/plen
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* description: List of static IP addresses.
|
2014-11-18 20:19:11 +01:00
|
|
|
* example: address1=abbe::cafe/96 address2=2001::1234
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* ---end---
|
2022-08-29 15:05:39 +02:00
|
|
|
*/
|
|
|
|
|
/* ---ifcfg-rh---
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* property: addresses
|
2014-11-18 20:19:11 +01:00
|
|
|
* variable: IPV6ADDR, IPV6ADDR_SECONDARIES
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* description: List of static IP addresses.
|
2014-11-18 20:19:11 +01:00
|
|
|
* example: IPV6ADDR=ab12:9876::1
|
|
|
|
|
* IPV6ADDR_SECONDARIES="ab12:9876::2 ab12:9876::3"
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ---keyfile---
|
|
|
|
|
* property: gateway
|
|
|
|
|
* variable: gateway
|
|
|
|
|
* format: string
|
|
|
|
|
* description: Gateway IP addresses as a string.
|
|
|
|
|
* example: gateway=abbe::1
|
|
|
|
|
* ---end---
|
2022-08-29 15:05:39 +02:00
|
|
|
*/
|
|
|
|
|
/* ---ifcfg-rh---
|
2014-11-18 20:19:11 +01:00
|
|
|
* property: gateway
|
|
|
|
|
* variable: IPV6_DEFAULTGW
|
|
|
|
|
* description: Gateway IP address.
|
|
|
|
|
* example: IPV6_DEFAULTGW=abbe::1
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ---keyfile---
|
|
|
|
|
* property: routes
|
|
|
|
|
* variable: route1, route2, ...
|
|
|
|
|
* format: route/plen[,gateway,metric]
|
|
|
|
|
* description: List of IP routes.
|
|
|
|
|
* example: route1=2001:4860:4860::/64,2620:52:0:2219:222:68ff:fe11:5403
|
|
|
|
|
* ---end---
|
2022-08-29 15:05:39 +02:00
|
|
|
*/
|
2023-08-29 15:47:10 +02:00
|
|
|
/* ---keyfile---
|
|
|
|
|
* property: routes (attributes)
|
|
|
|
|
* variable: route1_options, route2_options, ...
|
|
|
|
|
* format: key=val[,key=val...]
|
|
|
|
|
* description: Attributes defined for the routes, if any. The supported
|
|
|
|
|
* attributes are explained in ipv6.routes entry in `man nm-settings-nmcli`.
|
|
|
|
|
* example: route1_options=mtu=1000,onlink=true
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2022-08-29 15:05:39 +02:00
|
|
|
/* ---ifcfg-rh---
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* property: routes
|
|
|
|
|
* variable: (none)
|
|
|
|
|
* description: List of static routes. They are not stored in ifcfg-* file,
|
|
|
|
|
* but in route6-* file instead in the form of command line for 'ip route add'.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2023-08-29 15:47:10 +02:00
|
|
|
/* ---keyfile---
|
|
|
|
|
* property: routing-rules
|
|
|
|
|
* variable: routing-rule1, routing-rule2, ...
|
|
|
|
|
* format: routing rule string
|
|
|
|
|
* description: Routing rules as defined with `ip rule add`, but with mandatory
|
|
|
|
|
* fixed priority.
|
|
|
|
|
* example: routing-rule1=priority 5 from 2001:4860:4860::/64 table 45
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: ignore-auto-routes
|
|
|
|
|
* variable: IPV6_PEERROUTES(+)
|
|
|
|
|
* default: yes
|
|
|
|
|
* description: IPV6_PEERROUTES has the opposite meaning as 'ignore-auto-routes' property.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: ignore-auto-dns
|
|
|
|
|
* variable: IPV6_PEERDNS(+)
|
|
|
|
|
* default: yes
|
|
|
|
|
* description: IPV6_PEERDNS has the opposite meaning as 'ignore-auto-dns' property.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: dhcp-hostname
|
2019-08-05 11:01:30 +02:00
|
|
|
* variable: DHCPV6_HOSTNAME
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* description: Hostname to send the DHCP server.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-14 15:37:28 +01:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: dhcp-timeout
|
|
|
|
|
* variable: IPV6_DHCP_TIMEOUT(+)
|
|
|
|
|
* description: A timeout after which the DHCP transaction fails in case of no response.
|
|
|
|
|
* example: IPV6_DHCP_TIMEOUT=10
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2019-07-09 14:23:58 +02:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: dhcp-hostname-flags
|
|
|
|
|
* variable: DHCPV6_HOSTNAME_FLAGS
|
|
|
|
|
* description: flags for the DHCP hostname property
|
|
|
|
|
* example: DHCPV6_HOSTNAME_FLAGS=5
|
2021-05-03 10:27:42 +02:00
|
|
|
* ---end---
|
2019-07-09 14:23:58 +02:00
|
|
|
*/
|
|
|
|
|
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: never-default
|
|
|
|
|
* variable: IPV6_DEFROUTE(+), (and IPV6_DEFAULTGW, IPV6_DEFAULTDEV in /etc/sysconfig/network)
|
|
|
|
|
* default: IPV6_DEFROUTE=yes (when no variable specified)
|
|
|
|
|
* description: IPV6_DEFROUTE=no tells NetworkManager that this connection
|
|
|
|
|
* should not be assigned the default IPv6 route. IPV6_DEFROUTE has the opposite
|
|
|
|
|
* meaning as 'never-default' property.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: may-fail
|
|
|
|
|
* variable: IPV6_FAILURE_FATAL(+)
|
|
|
|
|
* default: no
|
|
|
|
|
* description: IPV6_FAILURE_FATAL has the opposite meaning as 'may-fail' property.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2014-12-22 15:10:22 +01:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: route-metric
|
|
|
|
|
* variable: IPV6_ROUTE_METRIC(+)
|
|
|
|
|
* default: -1
|
|
|
|
|
* description: IPV6_ROUTE_METRIC is the default IPv6 metric for routes on this connection.
|
|
|
|
|
* If set to -1, a default metric based on the device type is used.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-21 19:03:08 +02:00
|
|
|
/* ---ifcfg-rh---
|
all: rework configuring route table support by adding "route-table" setting
We added "ipv4.route-table-sync" and "ipv6.route-table-sync" to not change
behavior for users that configured policy routing outside of NetworkManager,
for example, via a dispatcher script. Users had to explicitly opt-in
for NetworkManager to fully manage all routing tables.
These settings were awkward. Replace them with new settings "ipv4.route-table"
and "ipv6.route-table". Note that this commit breaks API/ABI on the unstable
development branch by removing recently added API.
As before, a connection will have no route-table set by default. This
has the meaning that policy-routing is not enabled and only the main table
will be fully synced. Once the user sets a table, we recognize that and
NetworkManager manages all routing tables.
The new route-table setting has other important uses: analog to
"ipv4.route-metric", it is the default that applies to all routes.
Currently it only works for static routes, not DHCP, SLAAC,
default-route, etc. That will be implemented later.
For static routes, each route still can explicitly set a table, and
overwrite the per-connection setting in "ipv4.route-table" and
"ipv6.route-table".
2017-09-28 08:40:41 +02:00
|
|
|
* property: route-table
|
|
|
|
|
* variable: IPV6_ROUTE_TABLE(+)
|
2017-09-21 19:03:08 +02:00
|
|
|
* default: 0
|
all: rework configuring route table support by adding "route-table" setting
We added "ipv4.route-table-sync" and "ipv6.route-table-sync" to not change
behavior for users that configured policy routing outside of NetworkManager,
for example, via a dispatcher script. Users had to explicitly opt-in
for NetworkManager to fully manage all routing tables.
These settings were awkward. Replace them with new settings "ipv4.route-table"
and "ipv6.route-table". Note that this commit breaks API/ABI on the unstable
development branch by removing recently added API.
As before, a connection will have no route-table set by default. This
has the meaning that policy-routing is not enabled and only the main table
will be fully synced. Once the user sets a table, we recognize that and
NetworkManager manages all routing tables.
The new route-table setting has other important uses: analog to
"ipv4.route-metric", it is the default that applies to all routes.
Currently it only works for static routes, not DHCP, SLAAC,
default-route, etc. That will be implemented later.
For static routes, each route still can explicitly set a table, and
overwrite the per-connection setting in "ipv4.route-table" and
"ipv6.route-table".
2017-09-28 08:40:41 +02:00
|
|
|
* description: IPV6_ROUTE_TABLE enables policy-routing and sets the default routing table.
|
2017-09-21 19:03:08 +02:00
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2016-04-23 15:57:07 +02:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: dns-priority
|
|
|
|
|
* variable: IPV6_DNS_PRIORITY(+)
|
|
|
|
|
* description: The priority for DNS servers of this connection. Lower values have higher priority.
|
|
|
|
|
* If zero, the default value will be used (50 for VPNs, 100 for other connections).
|
|
|
|
|
* A negative value prevents DNS from other connections with greater values to be used.
|
|
|
|
|
* default: 0
|
|
|
|
|
* example: IPV6_DNS_PRIORITY=20
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2023-06-08 19:14:19 +02:00
|
|
|
/* ---nmcli---
|
|
|
|
|
* property: dns-options
|
|
|
|
|
* format: a comma separated list of DNS options
|
|
|
|
|
* description:
|
|
|
|
|
* DNS options for /etc/resolv.conf as described in resolv.conf(5) manual.
|
|
|
|
|
*
|
|
|
|
|
* The currently supported options are "attempts", "debug", "edns0",
|
|
|
|
|
* "ndots", "no-aaaa", "no-check-names", "no-reload", "no-tld-query",
|
|
|
|
|
* "rotate", "single-request", "single-request-reopen", "timeout",
|
|
|
|
|
* "trust-ad", "use-vc" and "inet6", "ip6-bytestring", "ip6-dotint",
|
|
|
|
|
* "no-ip6-dotint". See the resolv.conf(5) manual.
|
|
|
|
|
*
|
|
|
|
|
* Note that there is a distinction between an unset (default) list
|
|
|
|
|
* and an empty list. In nmcli, to unset the list set the value to
|
|
|
|
|
* "". To set an empty list, set it to " ". Currently, an unset list
|
|
|
|
|
* has the same meaning as an empty list. That might change in the future.
|
|
|
|
|
*
|
|
|
|
|
* The "trust-ad" setting is only honored if the profile contributes
|
|
|
|
|
* name servers to resolv.conf, and if all contributing profiles have
|
|
|
|
|
* "trust-ad" enabled.
|
|
|
|
|
*
|
|
|
|
|
* When using a caching DNS plugin (dnsmasq or systemd-resolved in
|
|
|
|
|
* NetworkManager.conf) then "edns0" and "trust-ad" are automatically
|
|
|
|
|
* added.
|
|
|
|
|
*
|
|
|
|
|
* The valid "ipv4.dns-options" and "ipv6.dns-options" get merged together.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2017-11-23 09:39:29 +01:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: dns-options
|
|
|
|
|
* variable: IPV6_RES_OPTIONS(+)
|
|
|
|
|
* description: List of DNS options to be added to /etc/resolv.conf
|
|
|
|
|
* example: IPV6_RES_OPTIONS=ndots:2 timeout:3
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2023-01-03 13:33:49 +01:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: auto-route-ext-gw
|
|
|
|
|
* variable: IPV6_AUTO_ROUTE_EXT_GW(+)
|
|
|
|
|
* default: yes
|
|
|
|
|
* description: VPN connections will default to add the route automatically unless this
|
|
|
|
|
* setting is set to %FALSE.
|
|
|
|
|
* For other connection types, adding such an automatic route is currently
|
|
|
|
|
* not supported and setting this to %TRUE has no effect.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2023-02-20 12:05:04 +01:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: replace-local-rule
|
|
|
|
|
* variable: IPV6_REPLACE_LOCAL_RULE(+)
|
|
|
|
|
* default: no
|
|
|
|
|
* description: Connections will default to keep the autogenerated priority
|
|
|
|
|
* 0 local rule unless this setting is set to %TRUE.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2014-07-24 08:53:33 -04:00
|
|
|
/**
|
|
|
|
|
* NMSettingIP6Config:ip6-privacy:
|
|
|
|
|
*
|
|
|
|
|
* Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If
|
|
|
|
|
* enabled, it makes the kernel generate a temporary IPv6 address in
|
|
|
|
|
* addition to the public one generated from MAC address via modified
|
|
|
|
|
* EUI-64. This enhances privacy, but could cause problems in some
|
2015-04-16 16:35:32 +02:00
|
|
|
* applications, on the other hand. The permitted values are: -1: unknown,
|
|
|
|
|
* 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary
|
2014-07-24 08:53:33 -04:00
|
|
|
* addresses).
|
2015-04-16 16:35:32 +02:00
|
|
|
*
|
2015-06-02 17:38:07 +02:00
|
|
|
* Having a per-connection setting set to "-1" (unknown) means fallback to
|
|
|
|
|
* global configuration "ipv6.ip6-privacy".
|
2015-04-16 16:38:00 +02:00
|
|
|
*
|
2015-06-02 17:38:07 +02:00
|
|
|
* If also global configuration is unspecified or set to "-1", fallback to read
|
2015-04-16 16:38:00 +02:00
|
|
|
* "/proc/sys/net/ipv6/conf/default/use_tempaddr".
|
2015-09-08 20:22:17 +02:00
|
|
|
*
|
|
|
|
|
* Note that this setting is distinct from the Stable Privacy addresses
|
|
|
|
|
* that can be enabled with the "addr-gen-mode" property's "stable-privacy"
|
|
|
|
|
* setting as another way of avoiding host tracking with IPv6 addresses.
|
2014-07-24 08:53:33 -04:00
|
|
|
**/
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: ip6-privacy
|
|
|
|
|
* variable: IPV6_PRIVACY, IPV6_PRIVACY_PREFER_PUBLIC_IP(+)
|
2014-11-19 09:57:20 +01:00
|
|
|
* values: IPV6_PRIVACY: no, yes (rfc3041 or rfc4941);
|
|
|
|
|
* IPV6_PRIVACY_PREFER_PUBLIC_IP: yes, no
|
|
|
|
|
* default: no
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* description: Configure IPv6 Privacy Extensions for SLAAC (RFC4941).
|
2014-11-19 09:57:20 +01:00
|
|
|
* example: IPV6_PRIVACY=rfc3041 IPV6_PRIVACY_PREFER_PUBLIC_IP=yes
|
libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.
With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).
The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...
(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-10-28 09:58:25 -04:00
|
|
|
* ---end---
|
|
|
|
|
*/
|
2021-11-24 09:43:37 +01:00
|
|
|
_nm_setting_property_define_direct_enum(properties_override,
|
|
|
|
|
obj_properties,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_IP6_PRIVACY,
|
|
|
|
|
PROP_IP6_PRIVACY,
|
|
|
|
|
NM_TYPE_SETTING_IP6_CONFIG_PRIVACY,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN,
|
|
|
|
|
NM_SETTING_PARAM_NONE,
|
|
|
|
|
NMSettingIP6ConfigPrivate,
|
|
|
|
|
ip6_privacy);
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2015-09-08 20:22:17 +02:00
|
|
|
/**
|
|
|
|
|
* NMSettingIP6Config:addr-gen-mode:
|
|
|
|
|
*
|
2023-05-17 10:40:09 +02:00
|
|
|
* Configure the method for creating the IPv6 interface identifier of
|
|
|
|
|
* addresses for RFC4862 IPv6 Stateless Address Autoconfiguration and IPv6
|
|
|
|
|
* Link Local.
|
|
|
|
|
*
|
|
|
|
|
* The permitted values are: %NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64,
|
2017-10-13 11:52:09 +02:00
|
|
|
* %NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY.
|
2023-05-17 10:40:09 +02:00
|
|
|
* %NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT_OR_EUI64 or
|
|
|
|
|
* %NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT.
|
2015-09-08 20:22:17 +02:00
|
|
|
*
|
2023-05-17 10:40:09 +02:00
|
|
|
* If the property is set to "eui64", the addresses will be generated using
|
|
|
|
|
* the interface token derived from the hardware address. This makes the
|
|
|
|
|
* host part of the address constant, making it possible to track the
|
|
|
|
|
* host's presence when it changes networks. The address changes when the
|
|
|
|
|
* interface hardware is replaced. If a duplicate address is detected,
|
|
|
|
|
* there is no fallback to generate another address. When configured, the
|
|
|
|
|
* "ipv6.token" is used instead of the MAC address to generate addresses
|
|
|
|
|
* for stateless autoconfiguration.
|
2015-09-08 20:22:17 +02:00
|
|
|
*
|
2023-05-17 10:40:09 +02:00
|
|
|
* If the property is set to "stable-privacy", the interface identifier is
|
|
|
|
|
* generated as specified by RFC7217. This works by hashing a host specific
|
|
|
|
|
* key (see NetworkManager(8) manual), the interface name, the connection's
|
|
|
|
|
* "connection.stable-id" property and the address prefix. This improves
|
|
|
|
|
* privacy by making it harder to use the address to track the host's
|
|
|
|
|
* presence as every prefix and network has a different identifier. Also,
|
|
|
|
|
* the address is stable when the network interface hardware is replaced.
|
2015-09-08 20:22:17 +02:00
|
|
|
*
|
2023-05-17 10:40:09 +02:00
|
|
|
* The special values "default" and "default-or-eui64" will fallback to the
|
|
|
|
|
* global connection default as documented in the NetworkManager.conf(5)
|
|
|
|
|
* manual. If the global default is not specified, the fallback value is
|
|
|
|
|
* "stable-privacy" or "eui64", respectively.
|
all: make "ipv6.addr-gen-mode" configurable by global default
It can be useful to choose a different "ipv6.addr-gen-mode". And it can be
useful to override the default for a set of profiles.
For example, in cloud or in a data center, stable-privacy might not be
the best choice. Add a mechanism to override the default via global defaults
in NetworkManager.conf:
# /etc/NetworkManager/conf.d/90-ipv6-addr-gen-mode-override.conf
[connection-90-ipv6-addr-gen-mode-override]
match-device=type:ethernet
ipv6.addr-gen-mode=0
"ipv6.addr-gen-mode" is a special property, because its default depends on
the component that configures the profile.
- when read from disk (keyfile and ifcfg-rh), a missing addr-gen-mode
key means to default to "eui64".
- when configured via D-Bus, a missing addr-gen-mode property means to
default to "stable-privacy".
- libnm's ip6-config::addr-gen-mode property defaults to
"stable-privacy".
- when some tool creates a profile, they either can explicitly
set the mode, or they get the default of the underlying mechanisms
above.
- nm-initrd-generator explicitly sets "eui64" for profiles it creates.
- nmcli doesn' explicitly set it, but inherits the default form
libnm's ip6-config::addr-gen-mode.
- when NM creates a auto-default-connection for ethernet ("Wired connection 1"),
it inherits the default from libnm's ip6-config::addr-gen-mode.
Global connection defaults only take effect when the per-profile
value is set to a special default/unset value. To account for the
different cases above, we add two such special values: "default" and
"default-or-eui64". That's something we didn't do before, but it seams
useful and easy to understand.
Also, this neatly expresses the current behaviors we already have. E.g.
if you don't specify the "addr-gen-mode" in a keyfile, "default-or-eui64"
is a pretty clear thing.
Note that usually we cannot change default values, in particular not for
libnm's properties. That is because we don't serialize the default
values to D-Bus/keyfile, so if we change the default, we change
behavior. Here we change from "stable-privacy" to "default" and
from "eui64" to "default-or-eui64". That means, the user only experiences
a change in behavior, if they have a ".conf" file that overrides the default.
https://bugzilla.redhat.com/show_bug.cgi?id=1743161
https://bugzilla.redhat.com/show_bug.cgi?id=2082682
See-also: https://github.com/coreos/fedora-coreos-tracker/issues/907
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1213
2022-05-06 16:57:51 +02:00
|
|
|
*
|
2023-05-17 10:40:09 +02:00
|
|
|
* For libnm, the property defaults to "default" since 1.40. Previously it
|
|
|
|
|
* used to default to "stable-privacy". On D-Bus, the absence of an
|
|
|
|
|
* addr-gen-mode setting equals "default". For keyfile plugin, the absence
|
|
|
|
|
* of the setting on disk means "default-or-eui64" so that the property
|
|
|
|
|
* doesn't change on upgrade from older versions.
|
2015-09-08 20:22:17 +02:00
|
|
|
*
|
|
|
|
|
* Note that this setting is distinct from the Privacy Extensions as
|
|
|
|
|
* configured by "ip6-privacy" property and it does not affect the
|
|
|
|
|
* temporary addresses configured with this option.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.2
|
|
|
|
|
**/
|
|
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: addr-gen-mode
|
|
|
|
|
* variable: IPV6_ADDR_GEN_MODE
|
all: make "ipv6.addr-gen-mode" configurable by global default
It can be useful to choose a different "ipv6.addr-gen-mode". And it can be
useful to override the default for a set of profiles.
For example, in cloud or in a data center, stable-privacy might not be
the best choice. Add a mechanism to override the default via global defaults
in NetworkManager.conf:
# /etc/NetworkManager/conf.d/90-ipv6-addr-gen-mode-override.conf
[connection-90-ipv6-addr-gen-mode-override]
match-device=type:ethernet
ipv6.addr-gen-mode=0
"ipv6.addr-gen-mode" is a special property, because its default depends on
the component that configures the profile.
- when read from disk (keyfile and ifcfg-rh), a missing addr-gen-mode
key means to default to "eui64".
- when configured via D-Bus, a missing addr-gen-mode property means to
default to "stable-privacy".
- libnm's ip6-config::addr-gen-mode property defaults to
"stable-privacy".
- when some tool creates a profile, they either can explicitly
set the mode, or they get the default of the underlying mechanisms
above.
- nm-initrd-generator explicitly sets "eui64" for profiles it creates.
- nmcli doesn' explicitly set it, but inherits the default form
libnm's ip6-config::addr-gen-mode.
- when NM creates a auto-default-connection for ethernet ("Wired connection 1"),
it inherits the default from libnm's ip6-config::addr-gen-mode.
Global connection defaults only take effect when the per-profile
value is set to a special default/unset value. To account for the
different cases above, we add two such special values: "default" and
"default-or-eui64". That's something we didn't do before, but it seams
useful and easy to understand.
Also, this neatly expresses the current behaviors we already have. E.g.
if you don't specify the "addr-gen-mode" in a keyfile, "default-or-eui64"
is a pretty clear thing.
Note that usually we cannot change default values, in particular not for
libnm's properties. That is because we don't serialize the default
values to D-Bus/keyfile, so if we change the default, we change
behavior. Here we change from "stable-privacy" to "default" and
from "eui64" to "default-or-eui64". That means, the user only experiences
a change in behavior, if they have a ".conf" file that overrides the default.
https://bugzilla.redhat.com/show_bug.cgi?id=1743161
https://bugzilla.redhat.com/show_bug.cgi?id=2082682
See-also: https://github.com/coreos/fedora-coreos-tracker/issues/907
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1213
2022-05-06 16:57:51 +02:00
|
|
|
* values: IPV6_ADDR_GEN_MODE: default, default-or-eui64, eui64, stable-privacy
|
|
|
|
|
* default: "default-or-eui64"
|
2015-09-08 20:22:17 +02:00
|
|
|
* description: Configure IPv6 Stable Privacy addressing for SLAAC (RFC7217).
|
|
|
|
|
* example: IPV6_ADDR_GEN_MODE=stable-privacy
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2023-05-17 11:51:34 +02:00
|
|
|
/* ---nmcli---
|
|
|
|
|
* property: addr-gen-mode
|
|
|
|
|
* format: one of "eui64" (0), "stable-privacy" (1), "default" (3) or "default-or-eui64" (2)
|
|
|
|
|
* description: Configure method for creating the
|
|
|
|
|
* IPv6 interface identifer of addresses with RFC4862 IPv6 Stateless
|
|
|
|
|
* Address Autoconfiguration and Link Local addresses.
|
|
|
|
|
*
|
|
|
|
|
* The permitted values are: "eui64" (0), "stable-privacy" (1), "default"
|
|
|
|
|
* (3) or "default-or-eui64" (2).
|
|
|
|
|
*
|
|
|
|
|
* If the property is set to "eui64", the addresses will be generated using
|
|
|
|
|
* the interface token derived from hardware address. This makes the host
|
|
|
|
|
* part of the address to stay constant, making it possible to track the
|
|
|
|
|
* host's presence when it changes networks. The address changes when the
|
|
|
|
|
* interface hardware is replaced. If a duplicate address is detected,
|
|
|
|
|
* there is also no fallback to generate another address. When configured,
|
|
|
|
|
* the "ipv6.token" is used instead of the MAC address to generate
|
|
|
|
|
* addresses for stateless autoconfiguration.
|
|
|
|
|
*
|
|
|
|
|
* If the property is set to "stable-privacy", the interface identifier is
|
|
|
|
|
* generated as specified by RFC7217. This works by hashing a host specific
|
|
|
|
|
* key (see NetworkManager(8) manual), the interface name, the connection's
|
|
|
|
|
* "connection.stable-id" property and the address prefix. This improves
|
|
|
|
|
* privacy by making it harder to use the address to track the host's
|
|
|
|
|
* presence and the address is stable when the network interface hardware
|
|
|
|
|
* is replaced.
|
|
|
|
|
*
|
|
|
|
|
* The special values "default" and "default-or-eui64" will fallback to the
|
|
|
|
|
* global connection default as documented in the NetworkManager.conf(5)
|
|
|
|
|
* manual. If the global default is not specified, the fallback value is
|
|
|
|
|
* "stable-privacy" or "eui64", respectively.
|
|
|
|
|
*
|
|
|
|
|
* If not specified, when creating a new profile the default is "default".
|
|
|
|
|
*
|
|
|
|
|
* Note that this setting is distinct from the Privacy Extensions as
|
|
|
|
|
* configured by "ip6-privacy" property and it does not affect the
|
|
|
|
|
* temporary addresses configured with this option.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2021-12-24 12:01:35 +01:00
|
|
|
_nm_setting_property_define_direct_int32(properties_override,
|
|
|
|
|
obj_properties,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE,
|
|
|
|
|
PROP_ADDR_GEN_MODE,
|
|
|
|
|
G_MININT32,
|
|
|
|
|
G_MAXINT32,
|
all: make "ipv6.addr-gen-mode" configurable by global default
It can be useful to choose a different "ipv6.addr-gen-mode". And it can be
useful to override the default for a set of profiles.
For example, in cloud or in a data center, stable-privacy might not be
the best choice. Add a mechanism to override the default via global defaults
in NetworkManager.conf:
# /etc/NetworkManager/conf.d/90-ipv6-addr-gen-mode-override.conf
[connection-90-ipv6-addr-gen-mode-override]
match-device=type:ethernet
ipv6.addr-gen-mode=0
"ipv6.addr-gen-mode" is a special property, because its default depends on
the component that configures the profile.
- when read from disk (keyfile and ifcfg-rh), a missing addr-gen-mode
key means to default to "eui64".
- when configured via D-Bus, a missing addr-gen-mode property means to
default to "stable-privacy".
- libnm's ip6-config::addr-gen-mode property defaults to
"stable-privacy".
- when some tool creates a profile, they either can explicitly
set the mode, or they get the default of the underlying mechanisms
above.
- nm-initrd-generator explicitly sets "eui64" for profiles it creates.
- nmcli doesn' explicitly set it, but inherits the default form
libnm's ip6-config::addr-gen-mode.
- when NM creates a auto-default-connection for ethernet ("Wired connection 1"),
it inherits the default from libnm's ip6-config::addr-gen-mode.
Global connection defaults only take effect when the per-profile
value is set to a special default/unset value. To account for the
different cases above, we add two such special values: "default" and
"default-or-eui64". That's something we didn't do before, but it seams
useful and easy to understand.
Also, this neatly expresses the current behaviors we already have. E.g.
if you don't specify the "addr-gen-mode" in a keyfile, "default-or-eui64"
is a pretty clear thing.
Note that usually we cannot change default values, in particular not for
libnm's properties. That is because we don't serialize the default
values to D-Bus/keyfile, so if we change the default, we change
behavior. Here we change from "stable-privacy" to "default" and
from "eui64" to "default-or-eui64". That means, the user only experiences
a change in behavior, if they have a ".conf" file that overrides the default.
https://bugzilla.redhat.com/show_bug.cgi?id=1743161
https://bugzilla.redhat.com/show_bug.cgi?id=2082682
See-also: https://github.com/coreos/fedora-coreos-tracker/issues/907
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1213
2022-05-06 16:57:51 +02:00
|
|
|
NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_DEFAULT,
|
2021-12-24 12:01:35 +01:00
|
|
|
NM_SETTING_PARAM_NONE,
|
|
|
|
|
NMSettingIP6ConfigPrivate,
|
libnm: avoid serializing "ipv6.addr-gen-mode" default to D-Bus
When serializing setting properties to GVariant/D-Bus, we usually
omit values that are set to the default. That is done by libnm(-core),
so it happens both on the daemon and client side. That might be
useful to avoid a large number of properties on D-Bus.
Before changing the default value for "ipv6.addr-gen-mode" ([1]), we
would not serialize the previous default value ("stable-privacy").
Now we would serialize the new default value ("default). This change
causes problems.
Scenario 1: have a profile in the daemon with "ipv6.addr-gen-mode=stable-privacy",
have an older daemon version before [1] and a newer client after [1]. Result:
The daemon exposes the profile on D-Bus without the addr-gen-mode
field (because it's the default). To the client, that is interpreted
differently, as "ipv6.addr-gen-mode=default". This is already somewhat
a problem.
More severe is when modifying the profile, the client would now serialize
the value "default" on D-Bus, which the older daemon rejects as invalid.
That means, you could not modify the profile, unless also resetting
addr-gen-mode to "stable-privacy" or "eui64".
You can imagine other scenarios where either the daemon or the client is
before/after change [1] and the addr-gen-mode is set to either "default"
or "stable-privacy". Depending on what scenario you look, that can either be
good or bad.
Scenario 1 is pretty bad, because it means `dnf upgrade NetworkManager
&& nmcli connection modify ...` will fail (if the daemon was not
restated). So try to fix Scenario 1, by also not serializing the new
default value on D-Bus. Of course, some of the scenarios will get
different problems, by exacerbating one side misunderstanding the actually
set value and interpreting a missing value on D-Bus wrongly. But those
problems are likely less severe.
In case both client and daemon are older/newer than [1], it doesn't
matter either way. The problem happens with different version and is
caused by a change of the default value.
[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/e6a33c04ebe1ac84e31628911e25bdfd7534dd3c
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1372
2022-09-08 13:06:13 +02:00
|
|
|
addr_gen_mode);
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2016-04-30 16:48:02 +02:00
|
|
|
/**
|
|
|
|
|
* NMSettingIP6Config:token:
|
|
|
|
|
*
|
|
|
|
|
* Configure the token for draft-chown-6man-tokenised-ipv6-identifiers-02
|
|
|
|
|
* IPv6 tokenized interface identifiers. Useful with eui64 addr-gen-mode.
|
|
|
|
|
*
|
2023-05-17 10:40:09 +02:00
|
|
|
* When set, the token is used as IPv6 interface identifier instead of the
|
|
|
|
|
* hardware address. This only applies to addresses from stateless
|
|
|
|
|
* autoconfiguration, not to IPv6 link local addresses.
|
|
|
|
|
*
|
2016-04-30 16:48:02 +02:00
|
|
|
* Since: 1.4
|
|
|
|
|
**/
|
|
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: token
|
|
|
|
|
* variable: IPV6_TOKEN
|
|
|
|
|
* description: The IPv6 tokenized interface identifier token
|
|
|
|
|
* example: IPV6_TOKEN=::53
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2021-06-28 17:28:21 +02:00
|
|
|
_nm_setting_property_define_direct_string(properties_override,
|
|
|
|
|
obj_properties,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_TOKEN,
|
|
|
|
|
PROP_TOKEN,
|
|
|
|
|
NM_SETTING_PARAM_INFERRABLE,
|
|
|
|
|
NMSettingIP6ConfigPrivate,
|
|
|
|
|
token);
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2020-02-13 15:41:35 +01:00
|
|
|
/**
|
|
|
|
|
* NMSettingIP6Config:ra-timeout:
|
|
|
|
|
*
|
|
|
|
|
* A timeout for waiting Router Advertisements in seconds. If zero (the default), a
|
|
|
|
|
* globally configured default is used. If still unspecified, the timeout depends on the
|
|
|
|
|
* sysctl settings of the device.
|
|
|
|
|
*
|
|
|
|
|
* Set to 2147483647 (MAXINT32) for infinity.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.24
|
|
|
|
|
**/
|
|
|
|
|
/* ---ifcfg-rh---
|
2022-08-29 11:27:17 +02:00
|
|
|
* property: ra-timeout
|
2020-02-13 15:41:35 +01:00
|
|
|
* variable: IPV6_RA_TIMEOUT(+)
|
|
|
|
|
* description: A timeout for waiting Router Advertisements in seconds.
|
|
|
|
|
* example: IPV6_RA_TIMEOUT=10
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2021-12-24 12:01:35 +01:00
|
|
|
_nm_setting_property_define_direct_int32(properties_override,
|
|
|
|
|
obj_properties,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_RA_TIMEOUT,
|
|
|
|
|
PROP_RA_TIMEOUT,
|
|
|
|
|
0,
|
|
|
|
|
G_MAXINT32,
|
|
|
|
|
0,
|
|
|
|
|
NM_SETTING_PARAM_FUZZY_IGNORE,
|
|
|
|
|
NMSettingIP6ConfigPrivate,
|
|
|
|
|
ra_timeout);
|
2020-02-13 15:41:35 +01:00
|
|
|
|
2022-05-19 15:27:38 -06:00
|
|
|
/**
|
|
|
|
|
* NMSettingIP6Config:mtu:
|
|
|
|
|
*
|
|
|
|
|
* Maximum transmission unit size, in bytes. If zero (the default), the MTU
|
|
|
|
|
* is set automatically from router advertisements or is left equal to the
|
|
|
|
|
* link-layer MTU. If greater than the link-layer MTU, or greater than zero
|
|
|
|
|
* but less than the minimum IPv6 MTU of 1280, this value has no effect.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.40
|
|
|
|
|
**/
|
|
|
|
|
_nm_setting_property_define_direct_uint32(properties_override,
|
|
|
|
|
obj_properties,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_MTU,
|
|
|
|
|
PROP_MTU,
|
|
|
|
|
0,
|
|
|
|
|
G_MAXUINT32,
|
|
|
|
|
0,
|
|
|
|
|
NM_SETTING_PARAM_FUZZY_IGNORE,
|
|
|
|
|
NMSettingIP6ConfigPrivate,
|
|
|
|
|
mtu);
|
|
|
|
|
|
2018-03-06 16:10:01 +01:00
|
|
|
/**
|
|
|
|
|
* NMSettingIP6Config:dhcp-duid:
|
|
|
|
|
*
|
|
|
|
|
* A string containing the DHCPv6 Unique Identifier (DUID) used by the dhcp
|
|
|
|
|
* client to identify itself to DHCPv6 servers (RFC 3315). The DUID is carried
|
|
|
|
|
* in the Client Identifier option.
|
|
|
|
|
* If the property is a hex string ('aa:bb:cc') it is interpreted as a binary
|
|
|
|
|
* DUID and filled as an opaque value in the Client Identifier option.
|
|
|
|
|
*
|
|
|
|
|
* The special value "lease" will retrieve the DUID previously used from the
|
|
|
|
|
* lease file belonging to the connection. If no DUID is found and "dhclient"
|
|
|
|
|
* is the configured dhcp client, the DUID is searched in the system-wide
|
|
|
|
|
* dhclient lease file. If still no DUID is found, or another dhcp client is
|
|
|
|
|
* used, a global and permanent DUID-UUID (RFC 6355) will be generated based
|
|
|
|
|
* on the machine-id.
|
|
|
|
|
*
|
|
|
|
|
* The special values "llt" and "ll" will generate a DUID of type LLT or LL
|
|
|
|
|
* (see RFC 3315) based on the current MAC address of the device. In order to
|
|
|
|
|
* try providing a stable DUID-LLT, the time field will contain a constant
|
|
|
|
|
* timestamp that is used globally (for all profiles) and persisted to disk.
|
|
|
|
|
*
|
|
|
|
|
* The special values "stable-llt", "stable-ll" and "stable-uuid" will generate
|
|
|
|
|
* a DUID of the corresponding type, derived from the connection's stable-id and
|
2018-11-02 11:44:05 +01:00
|
|
|
* a per-host unique key. You may want to include the "${DEVICE}" or "${MAC}" specifier
|
|
|
|
|
* in the stable-id, in case this profile gets activated on multiple devices.
|
2018-03-06 16:10:01 +01:00
|
|
|
* So, the link-layer address of "stable-ll" and "stable-llt" will be a generated
|
|
|
|
|
* address derived from the stable id. The DUID-LLT time value in the "stable-llt"
|
|
|
|
|
* option will be picked among a static timespan of three years (the upper bound
|
|
|
|
|
* of the interval is the same constant timestamp used in "llt").
|
|
|
|
|
*
|
|
|
|
|
* When the property is unset, the global value provided for "ipv6.dhcp-duid" is
|
|
|
|
|
* used. If no global value is provided, the default "lease" value is assumed.
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.12
|
|
|
|
|
**/
|
2018-04-06 18:25:06 +02:00
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: dhcp-duid
|
|
|
|
|
* variable: DHCPV6_DUID(+)
|
|
|
|
|
* description: A string sent to the DHCPv6 server to identify the local machine.
|
|
|
|
|
* Apart from the special values "lease", "stable-llt", "stable-ll", "stable-uuid",
|
|
|
|
|
* "llt" and "ll" a binary value in hex format is expected. An hex string where
|
|
|
|
|
* each octet is separated by a colon is also accepted.
|
|
|
|
|
* example: DHCPV6_DUID=LL; DHCPV6_DUID=0301deadbeef0001; DHCPV6_DUID=03:01:de:ad:be:ef:00:01
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2021-06-28 17:28:21 +02:00
|
|
|
_nm_setting_property_define_direct_string(properties_override,
|
|
|
|
|
obj_properties,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_DHCP_DUID,
|
|
|
|
|
PROP_DHCP_DUID,
|
|
|
|
|
NM_SETTING_PARAM_NONE,
|
|
|
|
|
NMSettingIP6ConfigPrivate,
|
|
|
|
|
dhcp_duid);
|
2018-03-06 16:10:01 +01:00
|
|
|
|
2022-10-24 17:08:02 +02:00
|
|
|
/**
|
|
|
|
|
* NMSettingIP6Config:dhcp-pd-hint:
|
|
|
|
|
*
|
|
|
|
|
* A IPv6 address followed by a slash and a prefix length. If set, the value is
|
|
|
|
|
* sent to the DHCPv6 server as hint indicating the prefix delegation (IA_PD) we
|
|
|
|
|
* want to receive.
|
|
|
|
|
* To only hint a prefix length without prefix, set the address part to the
|
|
|
|
|
* zero address (for example "::/60").
|
|
|
|
|
*
|
|
|
|
|
* Since: 1.44
|
|
|
|
|
**/
|
|
|
|
|
/* ---ifcfg-rh---
|
|
|
|
|
* property: dhcp-pd-hint
|
|
|
|
|
* variable: DHCPV6_PD_HINT(+)
|
|
|
|
|
* description: Hint for DHCPv6 prefix delegation
|
|
|
|
|
* example: DHCPV6_PD_HINT=2001:db8:1111:2220::/60
|
|
|
|
|
* DHCPV6_PD_HINT=::/60
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
_nm_setting_property_define_direct_string(properties_override,
|
|
|
|
|
obj_properties,
|
|
|
|
|
NM_SETTING_IP6_CONFIG_DHCP_PD_HINT,
|
|
|
|
|
PROP_DHCP_PD_HINT,
|
|
|
|
|
NM_SETTING_PARAM_NONE,
|
|
|
|
|
NMSettingIP6ConfigPrivate,
|
|
|
|
|
dhcp_pd_hint,
|
|
|
|
|
.direct_hook.set_string_fcn =
|
|
|
|
|
_set_string_fcn_dhcp_pd_hint);
|
|
|
|
|
|
2014-10-19 17:30:10 -04:00
|
|
|
/* IP6-specific property overrides */
|
2014-11-16 15:36:18 -05:00
|
|
|
|
|
|
|
|
/* ---dbus---
|
|
|
|
|
* property: dns
|
|
|
|
|
* format: array of byte array
|
|
|
|
|
* description: Array of IP addresses of DNS servers (in network byte order)
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2019-09-22 15:32:04 +02:00
|
|
|
_nm_properties_override_gobj(
|
|
|
|
|
properties_override,
|
|
|
|
|
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_DNS),
|
2021-06-29 21:53:55 +02:00
|
|
|
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aay"),
|
2022-10-27 21:10:45 +02:00
|
|
|
.compare_fcn = _nm_setting_ip_config_compare_fcn_dns,
|
libnm: add "dns-data" replacement for "ipv[46].dns" properties on D-Bus
On D-Bus, the properties "ipv[46].dns" are of type "au" and "aay",
respectively.
Btw, in particular "au" is bad, because we put there a big-endian
number. There is no D-Bus type to represent big endian numbers, so "u"
is bad because it can cause endianess problem when trying to remote
the D-Bus communication to another host (without explicitly
understanding which "u" properties need to swap for endinness).
Anyway. The plain addresses are not enough. We soon will also support
the DNS-over-TLS server name, or maybe a DoT port number. The previous
property was not extensible, so deprecate it and replace it by
"dns-data".
This one is just a list of strings. That is unlike "address-data" or
"route-data", which do a similar thing but are "a{sv}" dictionaries.
Here a string is supposed to be sufficient also for the future. Also,
because in nmcli and keyfile will will simply have a string format for
representing the extra data, not a structure (unlike for routes or
addresses).
2022-10-21 14:50:32 +02:00
|
|
|
.to_dbus_fcn = ip6_dns_to_dbus,
|
|
|
|
|
.from_dbus_fcn = ip6_dns_from_dbus, ),
|
|
|
|
|
.to_dbus_only_in_manager_process = TRUE,
|
|
|
|
|
.dbus_deprecated = TRUE);
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2014-11-16 15:36:18 -05:00
|
|
|
/* ---dbus---
|
|
|
|
|
* property: addresses
|
|
|
|
|
* format: array of legacy IPv6 address struct (a(ayuay))
|
|
|
|
|
* description: Deprecated in favor of the 'address-data' and 'gateway'
|
|
|
|
|
* properties, but this can be used for backward-compatibility with older
|
|
|
|
|
* daemons. Note that if you send this property the daemon will ignore
|
|
|
|
|
* 'address-data' and 'gateway'.
|
|
|
|
|
*
|
|
|
|
|
* Array of IPv6 address structures. Each IPv6 address structure is
|
2022-05-25 13:54:33 -06:00
|
|
|
* composed of an IPv6 address, a prefix length (0 - 128), and an IPv6
|
2014-11-16 15:36:18 -05:00
|
|
|
* gateway address. The gateway may be zeroed out if no gateway exists for
|
|
|
|
|
* that subnet.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2021-08-17 12:12:40 +02:00
|
|
|
/* ---nmcli---
|
|
|
|
|
* property: addresses
|
|
|
|
|
* format: a comma separated list of addresses
|
|
|
|
|
* description: A list of IPv6 addresses and their prefix length. Multiple addresses
|
|
|
|
|
* can be separated by comma. For example "2001:db8:85a3::8a2e:370:7334/64, 2001:db8:85a3::5/64".
|
2022-03-31 16:48:28 +02:00
|
|
|
* The addresses are listed in decreasing priority, meaning the first address will
|
|
|
|
|
* be the primary address. This can make a difference with IPv6 source address selection
|
|
|
|
|
* (RFC 6724, section 5).
|
2021-08-17 12:12:40 +02:00
|
|
|
* ---end---
|
|
|
|
|
*/
|
2019-09-22 15:32:04 +02:00
|
|
|
_nm_properties_override_gobj(
|
|
|
|
|
properties_override,
|
|
|
|
|
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ADDRESSES),
|
2021-06-18 09:44:46 +02:00
|
|
|
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a(ayuay)"),
|
2022-10-21 14:50:27 +02:00
|
|
|
.to_dbus_fcn = ip6_addresses_to_dbus,
|
2021-06-29 14:37:16 +02:00
|
|
|
.compare_fcn = _nm_setting_ip_config_compare_fcn_addresses,
|
2022-10-24 11:01:15 +02:00
|
|
|
.from_dbus_fcn = ip6_addresses_from_dbus, ),
|
libnm: refactor to-dbus on the client skipping to serialize legacy properties
We have 4 legacy properties ("ipv[46].addresses", "ipv[46].routes") that
got replaced by newer variants ("ipv[46].address-data", "ipv[46].route-data").
When the client side of libnm (_nm_utils_is_manager_process) serializes
those properties, it must only serialize the newer version. That is so
that the forward/backward compatibility works as intended.
Previously, there was the NM_SETTING_PARAM_LEGACY GObject property flag.
That was fine, but not very clear.
For one, the legacy part of those properties is only about D-Bus. In
particular, they are not deprecated in libnm, keyfile, or nmcli. Thus
the name wasn't very clear.
Also, in the meantime we have more elaborate property meta data, that
goes beyond the meta data of the GObject property.
Move NM_SETTING_PARAM_LEGACY to NMSettInfoProperty.to_dbus_only_in_manager_process.
I think, this is a better name. It's also right at
```
_nm_properties_override_gobj(
properties_override,
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ROUTES),
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a(ayuayu)"),
.to_dbus_fcn = ip6_routes_to_dbus,
.compare_fcn = _nm_setting_ip_config_compare_fcn_routes,
.from_dbus_fcn = ip6_routes_from_dbus, ),
.to_dbus_only_in_manager_process = TRUE,
.dbus_deprecated = TRUE, );
```
that is, directly at the place where we describe how the D-Bus property behaves.
2022-10-24 13:22:40 +02:00
|
|
|
.to_dbus_only_in_manager_process = TRUE,
|
|
|
|
|
.dbus_deprecated = TRUE, );
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2014-11-16 15:36:18 -05:00
|
|
|
/* ---dbus---
|
|
|
|
|
* property: address-data
|
|
|
|
|
* format: array of vardict
|
|
|
|
|
* description: Array of IPv6 addresses. Each address dictionary contains at
|
|
|
|
|
* least 'address' and 'prefix' entries, containing the IP address as a
|
|
|
|
|
* string, and the prefix length as a uint32. Additional attributes may
|
|
|
|
|
* also exist on some addresses.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2019-09-22 15:32:04 +02:00
|
|
|
_nm_properties_override_dbus(
|
|
|
|
|
properties_override,
|
|
|
|
|
"address-data",
|
2021-06-18 09:44:46 +02:00
|
|
|
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
2022-10-21 14:50:27 +02:00
|
|
|
.to_dbus_fcn = ip6_address_data_to_dbus,
|
2021-06-29 17:03:37 +02:00
|
|
|
.compare_fcn = _nm_setting_property_compare_fcn_ignore,
|
2022-10-21 14:50:27 +02:00
|
|
|
.from_dbus_fcn = ip6_address_data_from_dbus, ));
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2014-11-16 15:36:18 -05:00
|
|
|
/* ---dbus---
|
|
|
|
|
* property: routes
|
|
|
|
|
* format: array of legacy IPv6 route struct (a(ayuayu))
|
|
|
|
|
* description: Deprecated in favor of the 'route-data' property, but this
|
|
|
|
|
* can be used for backward-compatibility with older daemons. Note that if
|
|
|
|
|
* you send this property the daemon will ignore 'route-data'.
|
|
|
|
|
*
|
|
|
|
|
* Array of IPv6 route structures. Each IPv6 route structure is
|
2022-05-25 13:54:33 -06:00
|
|
|
* composed of an IPv6 address, a prefix length (0 - 128), an IPv6
|
2014-11-16 15:36:18 -05:00
|
|
|
* next hop address (which may be zeroed out if there is no next hop),
|
|
|
|
|
* and a metric. If the metric is 0, NM will choose an appropriate
|
|
|
|
|
* default metric for the device.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
libnm/doc: list route attributes in `man nm-settings-nmcli`
IPv4:
routes
A list of IPv4 destination addresses, prefix length, optional IPv4
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]". For example "192.0.2.0/24
10.1.1.1 77, 198.51.100.0/24".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "scope" - an unsigned 8 bit integer. IPv4 only.
• "src" - an IPv4 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv4.route-table.
• "tos" - an unsigned 8 bit integer. IPv4 only.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
IPv6:
routes
A list of IPv6 destination addresses, prefix length, optional IPv6
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "from" - an IPv6 address with optional prefix. IPv6 only.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "src" - an IPv6 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv6.route-table.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
(cherry picked from commit 7b1e9a5c3d146c7ddd83f552c290fc841388cfda)
2022-02-09 19:04:05 +01:00
|
|
|
/* ---nmcli---
|
|
|
|
|
* property: routes
|
|
|
|
|
* format: a comma separated list of routes
|
2023-05-18 21:41:38 +02:00
|
|
|
* description: Array of IP routes.
|
libnm/doc: list route attributes in `man nm-settings-nmcli`
IPv4:
routes
A list of IPv4 destination addresses, prefix length, optional IPv4
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]". For example "192.0.2.0/24
10.1.1.1 77, 198.51.100.0/24".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "scope" - an unsigned 8 bit integer. IPv4 only.
• "src" - an IPv4 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv4.route-table.
• "tos" - an unsigned 8 bit integer. IPv4 only.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
IPv6:
routes
A list of IPv6 destination addresses, prefix length, optional IPv6
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "from" - an IPv6 address with optional prefix. IPv6 only.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "src" - an IPv6 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv6.route-table.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
(cherry picked from commit 7b1e9a5c3d146c7ddd83f552c290fc841388cfda)
2022-02-09 19:04:05 +01:00
|
|
|
* description-docbook:
|
|
|
|
|
* <para>
|
|
|
|
|
* A list of IPv6 destination addresses, prefix length, optional IPv6
|
|
|
|
|
* next hop addresses, optional route metric, optional attribute. The valid syntax is:
|
|
|
|
|
* "ip[/prefix] [next-hop] [metric] [attribute=val]...[,ip[/prefix]...]".
|
|
|
|
|
* </para>
|
|
|
|
|
* <para>
|
|
|
|
|
* Various attributes are supported:
|
|
|
|
|
* <itemizedlist>
|
|
|
|
|
* <listitem>
|
2022-06-23 22:01:12 +02:00
|
|
|
* <para><literal>"advmss"</literal> - an unsigned 32 bit integer.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
libnm/doc: list route attributes in `man nm-settings-nmcli`
IPv4:
routes
A list of IPv4 destination addresses, prefix length, optional IPv4
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]". For example "192.0.2.0/24
10.1.1.1 77, 198.51.100.0/24".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "scope" - an unsigned 8 bit integer. IPv4 only.
• "src" - an IPv4 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv4.route-table.
• "tos" - an unsigned 8 bit integer. IPv4 only.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
IPv6:
routes
A list of IPv6 destination addresses, prefix length, optional IPv6
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "from" - an IPv6 address with optional prefix. IPv6 only.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "src" - an IPv6 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv6.route-table.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
(cherry picked from commit 7b1e9a5c3d146c7ddd83f552c290fc841388cfda)
2022-02-09 19:04:05 +01:00
|
|
|
* <para><literal>"cwnd"</literal> - an unsigned 32 bit integer.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"from"</literal> - an IPv6 address with optional prefix. IPv6 only.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"initcwnd"</literal> - an unsigned 32 bit integer.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"initrwnd"</literal> - an unsigned 32 bit integer.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
2022-06-23 22:01:12 +02:00
|
|
|
* <para><literal>"lock-advmss"</literal> - a boolean value.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
libnm/doc: list route attributes in `man nm-settings-nmcli`
IPv4:
routes
A list of IPv4 destination addresses, prefix length, optional IPv4
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]". For example "192.0.2.0/24
10.1.1.1 77, 198.51.100.0/24".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "scope" - an unsigned 8 bit integer. IPv4 only.
• "src" - an IPv4 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv4.route-table.
• "tos" - an unsigned 8 bit integer. IPv4 only.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
IPv6:
routes
A list of IPv6 destination addresses, prefix length, optional IPv6
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "from" - an IPv6 address with optional prefix. IPv6 only.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "src" - an IPv6 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv6.route-table.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
(cherry picked from commit 7b1e9a5c3d146c7ddd83f552c290fc841388cfda)
2022-02-09 19:04:05 +01:00
|
|
|
* <para><literal>"lock-cwnd"</literal> - a boolean value.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"lock-initcwnd"</literal> - a boolean value.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"lock-initrwnd"</literal> - a boolean value.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"lock-mtu"</literal> - a boolean value.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"lock-window"</literal> - a boolean value.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"mtu"</literal> - an unsigned 32 bit integer.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"onlink"</literal> - a boolean value.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
2022-06-23 22:01:12 +02:00
|
|
|
* <para><literal>"quickack"</literal> - a boolean value.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"rto_min"</literal> - an unsigned 32 bit integer.
|
|
|
|
|
* The value is in milliseconds.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
libnm/doc: list route attributes in `man nm-settings-nmcli`
IPv4:
routes
A list of IPv4 destination addresses, prefix length, optional IPv4
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]". For example "192.0.2.0/24
10.1.1.1 77, 198.51.100.0/24".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "scope" - an unsigned 8 bit integer. IPv4 only.
• "src" - an IPv4 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv4.route-table.
• "tos" - an unsigned 8 bit integer. IPv4 only.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
IPv6:
routes
A list of IPv6 destination addresses, prefix length, optional IPv6
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "from" - an IPv6 address with optional prefix. IPv6 only.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "src" - an IPv6 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv6.route-table.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
(cherry picked from commit 7b1e9a5c3d146c7ddd83f552c290fc841388cfda)
2022-02-09 19:04:05 +01:00
|
|
|
* <para><literal>"src"</literal> - an IPv6 address.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"table"</literal> - an unsigned 32 bit integer. The default depends on ipv6.route-table.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"type"</literal> - one of <literal>unicast</literal>, <literal>local</literal>, <literal>blackhole</literal>,
|
2023-02-28 00:43:35 -05:00
|
|
|
* <literal>unreachable</literal>, <literal>prohibit</literal>, <literal>throw</literal>.
|
2022-02-25 21:01:04 +01:00
|
|
|
* The default is <literal>unicast</literal>.</para>
|
libnm/doc: list route attributes in `man nm-settings-nmcli`
IPv4:
routes
A list of IPv4 destination addresses, prefix length, optional IPv4
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]". For example "192.0.2.0/24
10.1.1.1 77, 198.51.100.0/24".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "scope" - an unsigned 8 bit integer. IPv4 only.
• "src" - an IPv4 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv4.route-table.
• "tos" - an unsigned 8 bit integer. IPv4 only.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
IPv6:
routes
A list of IPv6 destination addresses, prefix length, optional IPv6
next hop addresses, optional route metric, optional attribute. The
valid syntax is: "ip[/prefix] [next-hop] [metric]
[attribute=val]...[,ip[/prefix]...]".
Various attributes are supported:
• "cwnd" - an unsigned 32 bit integer.
• "from" - an IPv6 address with optional prefix. IPv6 only.
• "initcwnd" - an unsigned 32 bit integer.
• "initrwnd" - an unsigned 32 bit integer.
• "lock-cwnd" - a boolean value.
• "lock-initcwnd" - a boolean value.
• "lock-initrwnd" - a boolean value.
• "lock-mtu" - a boolean value.
• "lock-window" - a boolean value.
• "mtu" - an unsigned 32 bit integer.
• "onlink" - a boolean value.
• "src" - an IPv6 address.
• "table" - an unsigned 32 bit integer. The default depends on
ipv6.route-table.
• "type" - one of unicast, local, blackhole, unavailable,
prohibit. The default is unicast.
• "window" - an unsigned 32 bit integer.
For details see also `man ip-route`.
Format: a comma separated list of routes
(cherry picked from commit 7b1e9a5c3d146c7ddd83f552c290fc841388cfda)
2022-02-09 19:04:05 +01:00
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"window"</literal> - an unsigned 32 bit integer.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* </itemizedlist>
|
|
|
|
|
* </para>
|
|
|
|
|
* <para>
|
|
|
|
|
* For details see also `man ip-route`.
|
|
|
|
|
* </para>
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2019-09-22 15:32:04 +02:00
|
|
|
_nm_properties_override_gobj(
|
|
|
|
|
properties_override,
|
|
|
|
|
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ROUTES),
|
2021-06-18 09:44:46 +02:00
|
|
|
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a(ayuayu)"),
|
2022-10-21 14:50:27 +02:00
|
|
|
.to_dbus_fcn = ip6_routes_to_dbus,
|
2021-06-29 14:37:16 +02:00
|
|
|
.compare_fcn = _nm_setting_ip_config_compare_fcn_routes,
|
2022-10-24 11:01:15 +02:00
|
|
|
.from_dbus_fcn = ip6_routes_from_dbus, ),
|
libnm: refactor to-dbus on the client skipping to serialize legacy properties
We have 4 legacy properties ("ipv[46].addresses", "ipv[46].routes") that
got replaced by newer variants ("ipv[46].address-data", "ipv[46].route-data").
When the client side of libnm (_nm_utils_is_manager_process) serializes
those properties, it must only serialize the newer version. That is so
that the forward/backward compatibility works as intended.
Previously, there was the NM_SETTING_PARAM_LEGACY GObject property flag.
That was fine, but not very clear.
For one, the legacy part of those properties is only about D-Bus. In
particular, they are not deprecated in libnm, keyfile, or nmcli. Thus
the name wasn't very clear.
Also, in the meantime we have more elaborate property meta data, that
goes beyond the meta data of the GObject property.
Move NM_SETTING_PARAM_LEGACY to NMSettInfoProperty.to_dbus_only_in_manager_process.
I think, this is a better name. It's also right at
```
_nm_properties_override_gobj(
properties_override,
g_object_class_find_property(G_OBJECT_CLASS(setting_class), NM_SETTING_IP_CONFIG_ROUTES),
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("a(ayuayu)"),
.to_dbus_fcn = ip6_routes_to_dbus,
.compare_fcn = _nm_setting_ip_config_compare_fcn_routes,
.from_dbus_fcn = ip6_routes_from_dbus, ),
.to_dbus_only_in_manager_process = TRUE,
.dbus_deprecated = TRUE, );
```
that is, directly at the place where we describe how the D-Bus property behaves.
2022-10-24 13:22:40 +02:00
|
|
|
.to_dbus_only_in_manager_process = TRUE,
|
|
|
|
|
.dbus_deprecated = TRUE, );
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2014-11-16 15:36:18 -05:00
|
|
|
/* ---dbus---
|
|
|
|
|
* property: route-data
|
|
|
|
|
* format: array of vardict
|
|
|
|
|
* description: Array of IPv6 routes. Each route dictionary contains at
|
|
|
|
|
* least 'dest' and 'prefix' entries, containing the destination IP
|
|
|
|
|
* address as a string, and the prefix length as a uint32. Most routes
|
|
|
|
|
* will also have a 'next-hop' entry, containing the next hop IP address as
|
|
|
|
|
* a string. If the route has a 'metric' entry (containing a uint32), that
|
|
|
|
|
* will be used as the metric for the route (otherwise NM will pick a
|
|
|
|
|
* default value appropriate to the device). Additional attributes may
|
|
|
|
|
* also exist on some routes.
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
2021-06-18 09:44:46 +02:00
|
|
|
_nm_properties_override_dbus(
|
|
|
|
|
properties_override,
|
|
|
|
|
"route-data",
|
|
|
|
|
NM_SETT_INFO_PROPERT_TYPE_DBUS(NM_G_VARIANT_TYPE("aa{sv}"),
|
2022-10-21 14:50:27 +02:00
|
|
|
.to_dbus_fcn = ip6_route_data_to_dbus,
|
2021-06-29 17:03:37 +02:00
|
|
|
.compare_fcn = _nm_setting_property_compare_fcn_ignore,
|
2022-10-21 14:50:27 +02:00
|
|
|
.from_dbus_fcn = ip6_route_data_from_dbus, ));
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2022-02-09 20:31:47 +01:00
|
|
|
/* ---nmcli---
|
|
|
|
|
* property: routing-rules
|
|
|
|
|
* format: a comma separated list of routing rules
|
|
|
|
|
* description: A comma separated list of routing rules for policy routing.
|
|
|
|
|
* description-docbook:
|
|
|
|
|
* <para>
|
|
|
|
|
* A comma separated list of routing rules for policy routing. The format
|
|
|
|
|
* is based on <command>ip rule add</command> syntax and mostly compatible.
|
|
|
|
|
* One difference is that routing rules in NetworkManager always need a
|
|
|
|
|
* fixed priority.
|
|
|
|
|
* </para>
|
|
|
|
|
* <para>
|
|
|
|
|
* Example: <literal>priority 5 from 1:2:3::5/128 table 45</literal>
|
|
|
|
|
* </para>
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2023-04-20 16:57:24 +02:00
|
|
|
/* ---nmcli---
|
|
|
|
|
* property: method
|
|
|
|
|
* format: string
|
|
|
|
|
* description: The IPv6 connection method.
|
|
|
|
|
* description-docbook:
|
|
|
|
|
* <para>
|
|
|
|
|
* Sets the IPv6 connection method. You can set one of the following values:
|
|
|
|
|
* </para>
|
|
|
|
|
* <para>
|
|
|
|
|
* <itemizedlist>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"auto"</literal> - Enables IPv6 auto-configuration. By default, NetworkManager uses Router Advertisements and, if the router announces the "managed" flag, NetworkManager requests an IPv6 address and prefix from a DHCPv6 server.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"dhcp"</literal> - Requests an IPv6 address and prefix from a DHCPv6 server. Note that DHCPv6 does not have options to provide routes and the default gateway. As a consequence, by using the "dhcp" method, connections are limited to their own subnet.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"manual"</literal> - Enables the configuration of static IPv6 addresses on the interface. Note that you must set at least one IP address and prefix in the "ipv6.addresses" property.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"disabled"</literal> - Disables the IPv6 protocol in this connection profile.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"ignore"</literal> - Configures NetworkManager to make no changes to the IPv6 configuration on the interface. For example, you can then use the "accept_ra" feature of the kernel to accept Router Advertisements.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"shared"</literal> - Provides network access to other computers. NetworkManager requests a prefix from an upstream DHCPv6 server, assigns an address to the interface, and announces the prefix to clients that connect to this interface.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* <listitem>
|
|
|
|
|
* <para><literal>"link-local"</literal> - Assigns a random link-local address from the fe80::/64 subnet to the interface.</para>
|
|
|
|
|
* </listitem>
|
|
|
|
|
* </itemizedlist>
|
|
|
|
|
* <para>
|
|
|
|
|
* If you set <literal>"auto"</literal>, <literal>"dhcp"</literal>, <literal>"manual"</literal>, <literal>"ignore"</literal>, or <literal>"shared"</literal>, NetworkManager assigns, in addition to the global address, an IPv6 link-local address to the interface. This is compliant with RFC 4291.
|
|
|
|
|
* </para>
|
|
|
|
|
* </para>
|
|
|
|
|
* ---end---
|
|
|
|
|
*/
|
|
|
|
|
|
2019-01-11 08:28:26 +01:00
|
|
|
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
2020-09-28 16:03:33 +02:00
|
|
|
|
2021-06-28 14:53:16 +02:00
|
|
|
_nm_setting_class_commit(setting_class,
|
|
|
|
|
NM_META_SETTING_TYPE_IP6_CONFIG,
|
|
|
|
|
NULL,
|
|
|
|
|
properties_override,
|
libnm: embed private structure in NMSetting and avoid g_type_class_add_private()
Historically, the NMSetting types were in public headers. Theoretically,
that allowed users to subtype our classes. However in practice that was
impossible because they lacked required access to internal functions to
fully create an NMSetting class outside of libnm. And it also was not
useful, because you simply cannot extend libnm by subtyping a libnm
class. And supporting such a use case would be hard and limit what we can
do in libnm.
Having GObject structs in public headers also require that we don't
change it's layout. The ABI of those structs must not change, if anybody
out there was actually subclassing our GObjects.
In libnm 1.34 (commit e46d484fae9e ('libnm: hide NMSetting types from
public headers')) we moved the structs from headers to internal.
This would have caused a compiler error if anybody was using those
struct definitions. However, we still didn't change the ABI/layout so
that we didn't break users who relied on it (for whatever reason).
It doesn't seem there were any affected user. We waited long enough.
Change internal ABI.
No longer use g_type_class_add_private(). Instead, embed the private
structs directly (_NM_GET_PRIVATE()) or indirectly
(_NM_GET_PRIVATE_PTR()) in the object.
The main benefit is for debugging in the debugger, where we can now
easily find the private data. Previously that was so cumbersome to be
effectively impossible.
It's also the fastest possible way, since NM_SETTING_*_GET_PRIVATE()
literally resolves to "&self->_priv" (plus static asserts and
nm_assert() for type checking).
_NM_GET_PRIVATE() also propagates constness and requires that the
argument is a compatible pointer type (at compile time).
Note that g_type_class_add_private() is also deprecated in glib 2.58 and
replaced by G_ADD_PRIVATE(). For one, we still don't rely on 2.58. Also,
G_ADD_PRIVATE() is a worse solution as it supports a usecase that we
don't care for (public structs in headers). _NM_GET_PRIVATE() is still
faster, works with older glib and most importantly: is better for
debugging as you can find the private data from an object pointer.
For NMSettingIPConfig this is rather awkward, because all direct
properties require a common "klass->private_offset". This was however
the case before this change. Nothing new here. And if you ever touch
this and do something wrong, many unit tests will fail. It's almost
impossible to get wrong, albeit it can be confusing to understand.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1773
2023-10-24 19:05:50 +02:00
|
|
|
G_STRUCT_OFFSET(NMSettingIP6Config, _priv));
|
2014-07-24 08:53:33 -04:00
|
|
|
}
|