mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-11 12:48:10 +02:00
Compare commits
46 commits
1.57.3-dev
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81209b4688 | ||
|
|
f1024d047f | ||
|
|
19b065bc4a | ||
|
|
1747eb96d6 | ||
|
|
09784fcce3 | ||
|
|
9303996b44 | ||
|
|
ca326bd636 | ||
|
|
3d4ad7b4ba | ||
|
|
33871478b7 | ||
|
|
00f9a3d862 | ||
|
|
8685ac1845 | ||
|
|
56099c5e14 | ||
|
|
4565c9efe4 | ||
|
|
6b038ef4dc | ||
|
|
921fe6ec68 | ||
|
|
95a329a927 | ||
|
|
09e2de8b68 | ||
|
|
372fb5792c | ||
|
|
631127d2e5 | ||
|
|
fe793cd783 | ||
|
|
0b3db7c6ee | ||
|
|
6a841072ec | ||
|
|
e8f379abb8 | ||
|
|
bd0a6356eb | ||
|
|
5e02f13611 | ||
|
|
834ae00607 | ||
|
|
d9c143ee58 | ||
|
|
230009b9e8 | ||
|
|
253ce99d2c | ||
|
|
c86ae51240 | ||
|
|
9ca09aa020 | ||
|
|
a6e133d5f4 | ||
|
|
330cb6a20b | ||
|
|
92bf0178a4 | ||
|
|
e50272de78 | ||
|
|
72950e5d5b | ||
|
|
e5d2c7cc6d | ||
|
|
bb50e8f0f4 | ||
|
|
2e1ee043a7 | ||
|
|
58f4c81673 | ||
|
|
24c50803a7 | ||
|
|
7f4efc484c | ||
|
|
1970d8a8cd | ||
|
|
de91bd8070 | ||
|
|
66ac355c52 | ||
|
|
fb1104d278 |
42 changed files with 15497 additions and 18912 deletions
3
NEWS
3
NEWS
|
|
@ -61,6 +61,9 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
|
||||||
* Allow persisting the managed state across reboots from nmcli and the D-Bus API.
|
* Allow persisting the managed state across reboots from nmcli and the D-Bus API.
|
||||||
* Allow changing the device's administrative state in the kernel at the same
|
* Allow changing the device's administrative state in the kernel at the same
|
||||||
time as a change to the managed state from nmcli and the D-Bus API.
|
time as a change to the managed state from nmcli and the D-Bus API.
|
||||||
|
* Allow configuring all bond options in nmtui by introducing a
|
||||||
|
"other options" field, which covers options not already covered by a
|
||||||
|
dedicated input field.
|
||||||
|
|
||||||
=============================================
|
=============================================
|
||||||
NetworkManager-1.56
|
NetworkManager-1.56
|
||||||
|
|
|
||||||
|
|
@ -100,11 +100,7 @@ Release: __RELEASE_VERSION__%{?dist}
|
||||||
%else
|
%else
|
||||||
%bcond_without iwd
|
%bcond_without iwd
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?fedora} <= 43 || 0%{?rhel} <= 10
|
|
||||||
%bcond_without polkit_noauth_group
|
%bcond_without polkit_noauth_group
|
||||||
%else
|
|
||||||
%bcond_with polkit_noauth_group
|
|
||||||
%endif
|
|
||||||
%ifarch %{ix86}
|
%ifarch %{ix86}
|
||||||
# there is no bpftool in i686
|
# there is no bpftool in i686
|
||||||
%bcond_with clat
|
%bcond_with clat
|
||||||
|
|
@ -178,10 +174,7 @@ Source9: readme-ifcfg-rh-migrated.txt
|
||||||
#Patch1: 0001-some.patch
|
#Patch1: 0001-some.patch
|
||||||
|
|
||||||
Requires(post): systemd
|
Requires(post): systemd
|
||||||
Requires(post): systemd-udev
|
|
||||||
Requires(post): /usr/sbin/update-alternatives
|
|
||||||
Requires(preun): systemd
|
Requires(preun): systemd
|
||||||
Requires(preun): /usr/sbin/update-alternatives
|
|
||||||
Requires(postun): systemd
|
Requires(postun): systemd
|
||||||
|
|
||||||
Requires: dbus >= %{dbus_version}
|
Requires: dbus >= %{dbus_version}
|
||||||
|
|
@ -566,6 +559,8 @@ Group: System Environment/Base
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Requires: NetworkManager
|
Requires: NetworkManager
|
||||||
Requires: /usr/bin/nmcli
|
Requires: /usr/bin/nmcli
|
||||||
|
Requires(post): /usr/sbin/update-alternatives
|
||||||
|
Requires(preun): /usr/sbin/update-alternatives
|
||||||
Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
|
Obsoletes: NetworkManager < %{obsoletes_initscripts_updown}
|
||||||
|
|
||||||
%description initscripts-updown
|
%description initscripts-updown
|
||||||
|
|
@ -844,8 +839,12 @@ fi
|
||||||
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
/usr/bin/udevadm control --reload-rules || :
|
# skip triggering if udevd isn't even accessible, e.g. containers or
|
||||||
/usr/bin/udevadm trigger --subsystem-match=net || :
|
# rpm-ostree-based systems
|
||||||
|
if [ -S /run/udev/control ]; then
|
||||||
|
/usr/bin/udevadm control --reload-rules || :
|
||||||
|
/usr/bin/udevadm trigger --subsystem-match=net || :
|
||||||
|
fi
|
||||||
%firewalld_reload
|
%firewalld_reload
|
||||||
|
|
||||||
%systemd_postun %{systemd_units}
|
%systemd_postun %{systemd_units}
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
x="19.192902"
|
x="19.192902"
|
||||||
y="360.40768"
|
y="360.40768"
|
||||||
id="tspan3839">Retrieves, adds, and notifes of changes</tspan><tspan
|
id="tspan3839">Retrieves, adds, and notifies of changes</tspan><tspan
|
||||||
sodipodi:role="line"
|
sodipodi:role="line"
|
||||||
x="19.192902"
|
x="19.192902"
|
||||||
y="372.90768"
|
y="372.90768"
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
|
@ -143,7 +143,7 @@
|
||||||
script is to automatically pick up changes to the network.</para>
|
script is to automatically pick up changes to the network.</para>
|
||||||
|
|
||||||
<para>The dispatcher script will do nothing, unless the systemd service is
|
<para>The dispatcher script will do nothing, unless the systemd service is
|
||||||
enabled. To use the dispatcher script you should therefor run
|
enabled. To use the dispatcher script you should therefore run
|
||||||
<command>systemctl enable nm-cloud-setup.service</command> once.</para>
|
<command>systemctl enable nm-cloud-setup.service</command> once.</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
|
|
@ -197,7 +197,7 @@
|
||||||
<para>Enable debug logging by setting <literal>NM_CLOUD_SETUP_LOG</literal> environment variable to <literal>TRACE</literal>.</para>
|
<para>Enable debug logging by setting <literal>NM_CLOUD_SETUP_LOG</literal> environment variable to <literal>TRACE</literal>.</para>
|
||||||
<para>In the common case where nm-cloud-setup is running as systemd service, this can be done via <command>systemctl edit nm-cloud-setup.service</command>
|
<para>In the common case where nm-cloud-setup is running as systemd service, this can be done via <command>systemctl edit nm-cloud-setup.service</command>
|
||||||
and add <literal>Environment=NM_CLOUD_SETUP_LOG=TRACE</literal> to the <literal>[Service]</literal> section. Afterwards, the log can
|
and add <literal>Environment=NM_CLOUD_SETUP_LOG=TRACE</literal> to the <literal>[Service]</literal> section. Afterwards, the log can
|
||||||
be found in syslog via <literal>journalctl</literal>. You may also want to enable debug logging in NetworkManager as descibed
|
be found in syslog via <literal>journalctl</literal>. You may also want to enable debug logging in NetworkManager as described
|
||||||
in the DEBUGGING section in <link linkend='NetworkManager'><citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>
|
in the DEBUGGING section in <link linkend='NetworkManager'><citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>
|
||||||
manual. When sharing logs, it's best to share complete logs and not preemptively filter for NetworkManager or nm-cloud-setup logs.</para>
|
manual. When sharing logs, it's best to share complete logs and not preemptively filter for NetworkManager or nm-cloud-setup logs.</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ project(
|
||||||
# NOTE: When incrementing version also add corresponding
|
# NOTE: When incrementing version also add corresponding
|
||||||
# NM_VERSION_x_y_z macros in
|
# NM_VERSION_x_y_z macros in
|
||||||
# "src/libnm-core-public/nm-version-macros.h.in"
|
# "src/libnm-core-public/nm-version-macros.h.in"
|
||||||
version: '1.57.3-dev',
|
version: '1.57.4-dev',
|
||||||
license: 'GPL2+',
|
license: 'GPL2+',
|
||||||
default_options: [
|
default_options: [
|
||||||
'buildtype=debugoptimized',
|
'buildtype=debugoptimized',
|
||||||
|
|
@ -296,7 +296,8 @@ config_h.set10('WITH_JANSSON', jansson_dep.found())
|
||||||
jansson_msg = 'no'
|
jansson_msg = 'no'
|
||||||
if jansson_dep.found()
|
if jansson_dep.found()
|
||||||
jansson_libdir = jansson_dep.get_variable(pkgconfig: 'libdir')
|
jansson_libdir = jansson_dep.get_variable(pkgconfig: 'libdir')
|
||||||
res = run_command(find_program('eu-readelf', 'readelf'), '-d', join_paths(jansson_libdir, 'libjansson.so'), check: false)
|
jansson_sysroot = meson.is_cross_build() ? meson.get_external_property('sys_root', '') : ''
|
||||||
|
res = run_command(find_program('eu-readelf', 'readelf'), '-d', jansson_sysroot + join_paths(jansson_libdir, 'libjansson.so'), check: false)
|
||||||
jansson_soname = ''
|
jansson_soname = ''
|
||||||
foreach line: res.stdout().split('\n')
|
foreach line: res.stdout().split('\n')
|
||||||
if line.strip().contains('SONAME')
|
if line.strip().contains('SONAME')
|
||||||
|
|
|
||||||
15974
po/sr@latin.po
15974
po/sr@latin.po
File diff suppressed because it is too large
Load diff
|
|
@ -52,11 +52,12 @@
|
||||||
NM_SETTING_BOND_OPTION_PACKETS_PER_SLAVE, NM_SETTING_BOND_OPTION_PRIMARY_RESELECT, \
|
NM_SETTING_BOND_OPTION_PACKETS_PER_SLAVE, NM_SETTING_BOND_OPTION_PRIMARY_RESELECT, \
|
||||||
NM_SETTING_BOND_OPTION_RESEND_IGMP, NM_SETTING_BOND_OPTION_USE_CARRIER, \
|
NM_SETTING_BOND_OPTION_RESEND_IGMP, NM_SETTING_BOND_OPTION_USE_CARRIER, \
|
||||||
NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP, \
|
NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP, \
|
||||||
NM_SETTING_BOND_OPTION_PEER_NOTIF_DELAY, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX
|
NM_SETTING_BOND_OPTION_PEER_NOTIF_DELAY
|
||||||
|
|
||||||
#define OPTIONS_REAPPLY_FULL \
|
#define OPTIONS_REAPPLY_FULL \
|
||||||
OPTIONS_REAPPLY_SUBSET, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE, \
|
OPTIONS_REAPPLY_SUBSET, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE, \
|
||||||
NM_SETTING_BOND_OPTION_ARP_IP_TARGET, NM_SETTING_BOND_OPTION_NS_IP6_TARGET
|
NM_SETTING_BOND_OPTION_ARP_IP_TARGET, NM_SETTING_BOND_OPTION_NS_IP6_TARGET, \
|
||||||
|
NM_SETTING_BOND_OPTION_ARP_MISSED_MAX
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
@ -501,6 +502,8 @@ _platform_lnk_bond_init_from_setting(NMSettingBond *s_bond, NMPlatformLnkBond *p
|
||||||
props->lp_interval_has = props->lp_interval != 1;
|
props->lp_interval_has = props->lp_interval != 1;
|
||||||
props->tlb_dynamic_lb_has = NM_IN_SET(props->mode, NM_BOND_MODE_TLB, NM_BOND_MODE_ALB);
|
props->tlb_dynamic_lb_has = NM_IN_SET(props->mode, NM_BOND_MODE_TLB, NM_BOND_MODE_ALB);
|
||||||
props->lacp_active_has = NM_IN_SET(props->mode, NM_BOND_MODE_8023AD);
|
props->lacp_active_has = NM_IN_SET(props->mode, NM_BOND_MODE_8023AD);
|
||||||
|
props->arp_missed_max_has =
|
||||||
|
!NM_IN_SET(props->mode, NM_BOND_MODE_TLB, NM_BOND_MODE_ALB, NM_BOND_MODE_8023AD);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -907,6 +910,8 @@ reapply_connection(NMDevice *device, NMConnection *con_old, NMConnection *con_ne
|
||||||
set_bond_arp_ip_targets(device, s_bond);
|
set_bond_arp_ip_targets(device, s_bond);
|
||||||
|
|
||||||
set_bond_attrs_or_default(device, s_bond, NM_MAKE_STRV(OPTIONS_REAPPLY_SUBSET));
|
set_bond_attrs_or_default(device, s_bond, NM_MAKE_STRV(OPTIONS_REAPPLY_SUBSET));
|
||||||
|
if (!NM_IN_SET(mode, NM_BOND_MODE_TLB, NM_BOND_MODE_ALB, NM_BOND_MODE_8023AD))
|
||||||
|
set_bond_attr_or_default(device, s_bond, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX);
|
||||||
|
|
||||||
_balance_slb_setup(self, con_new);
|
_balance_slb_setup(self, con_new);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,12 @@ static const NMDBusInterfaceInfoExtended interface_info_device_macvlan = {
|
||||||
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("NoPromisc",
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("NoPromisc",
|
||||||
"b",
|
"b",
|
||||||
NM_DEVICE_MACVLAN_NO_PROMISC),
|
NM_DEVICE_MACVLAN_NO_PROMISC),
|
||||||
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Tab", "b", NM_DEVICE_MACVLAN_TAP), ), ),
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Tap", "b", NM_DEVICE_MACVLAN_TAP),
|
||||||
|
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE(
|
||||||
|
"Tab",
|
||||||
|
"b",
|
||||||
|
NM_DEVICE_MACVLAN_TAP,
|
||||||
|
.annotations = NM_GDBUS_ANNOTATION_INFO_LIST_DEPRECATED(), ), ), ),
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ update_properties(NMDevice *device)
|
||||||
nm_device_parent_set_ifindex(device, peer_ifindex);
|
nm_device_parent_set_ifindex(device, peer_ifindex);
|
||||||
|
|
||||||
peer = nm_device_parent_get_device(device);
|
peer = nm_device_parent_get_device(device);
|
||||||
if (peer && NM_IS_DEVICE_VETH(peer) && nm_device_parent_get_ifindex(peer) <= 0)
|
if (peer && NM_IS_DEVICE_VETH(peer) && !nm_device_parent_get_device(peer))
|
||||||
update_properties(peer);
|
update_properties(peer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7234,7 +7234,9 @@ nm_device_controller_release_port(NMDevice *self,
|
||||||
|
|
||||||
info = find_port_info(self, port);
|
info = find_port_info(self, port);
|
||||||
|
|
||||||
if (info->port_state == PORT_STATE_ATTACHED)
|
if (!info)
|
||||||
|
port_state_str = "(not registered)";
|
||||||
|
else if (info->port_state == PORT_STATE_ATTACHED)
|
||||||
port_state_str = "(attached)";
|
port_state_str = "(attached)";
|
||||||
else if (info->port_state == PORT_STATE_NOT_ATTACHED)
|
else if (info->port_state == PORT_STATE_NOT_ATTACHED)
|
||||||
port_state_str = "(not attached)";
|
port_state_str = "(not attached)";
|
||||||
|
|
@ -7247,7 +7249,7 @@ nm_device_controller_release_port(NMDevice *self,
|
||||||
"controller: release one port " NM_HASH_OBFUSCATE_PTR_FMT "/%s %s%s",
|
"controller: release one port " NM_HASH_OBFUSCATE_PTR_FMT "/%s %s%s",
|
||||||
NM_HASH_OBFUSCATE_PTR(port),
|
NM_HASH_OBFUSCATE_PTR(port),
|
||||||
nm_device_get_iface(port),
|
nm_device_get_iface(port),
|
||||||
!info ? "(not registered)" : port_state_str,
|
port_state_str,
|
||||||
release_type == RELEASE_PORT_TYPE_CONFIG_FORCE
|
release_type == RELEASE_PORT_TYPE_CONFIG_FORCE
|
||||||
? " (force-configure)"
|
? " (force-configure)"
|
||||||
: (release_type == RELEASE_PORT_TYPE_CONFIG ? " (configure)" : "(no-config)"));
|
: (release_type == RELEASE_PORT_TYPE_CONFIG ? " (configure)" : "(no-config)"));
|
||||||
|
|
@ -17978,6 +17980,14 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
|
||||||
nm_device_cleanup(self, reason, CLEANUP_TYPE_DECONFIGURE);
|
nm_device_cleanup(self, reason, CLEANUP_TYPE_DECONFIGURE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NM_DEVICE_STATE_DEACTIVATING:
|
||||||
|
/* When deactivating, certain devices are removed/disconnected after the
|
||||||
|
* STATE_CHANGED signal is sent and before the DHCP release packet
|
||||||
|
* can be sent. To ensure the release packet is sent, we cleanup DHCP
|
||||||
|
* before the signal is emitted*/
|
||||||
|
_dev_ipdhcpx_cleanup(self, AF_INET, TRUE, FALSE);
|
||||||
|
_dev_ipdhcpx_cleanup(self, AF_INET6, TRUE, FALSE);
|
||||||
|
break;
|
||||||
case NM_DEVICE_STATE_DISCONNECTED:
|
case NM_DEVICE_STATE_DISCONNECTED:
|
||||||
if (old_state > NM_DEVICE_STATE_DISCONNECTED) {
|
if (old_state > NM_DEVICE_STATE_DISCONNECTED) {
|
||||||
/* Ensure devices that previously assumed a connection now have
|
/* Ensure devices that previously assumed a connection now have
|
||||||
|
|
@ -18027,6 +18037,7 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
|
||||||
(guint32) state,
|
(guint32) state,
|
||||||
(guint32) old_state,
|
(guint32) old_state,
|
||||||
(guint32) reason);
|
(guint32) reason);
|
||||||
|
|
||||||
g_signal_emit(self,
|
g_signal_emit(self,
|
||||||
signals[STATE_CHANGED],
|
signals[STATE_CHANGED],
|
||||||
0,
|
0,
|
||||||
|
|
|
||||||
|
|
@ -289,8 +289,10 @@ nm_dhcp_manager_init(NMDhcpManager *self)
|
||||||
NM_CONFIG_GET_VALUE_STRIP | NM_CONFIG_GET_VALUE_NO_EMPTY);
|
NM_CONFIG_GET_VALUE_STRIP | NM_CONFIG_GET_VALUE_NO_EMPTY);
|
||||||
client = client_free;
|
client = client_free;
|
||||||
if (client) {
|
if (client) {
|
||||||
client_factory = _client_factory_available(_client_factory_find_by_name(client));
|
client_factory = _client_factory_find_by_name(client);
|
||||||
if (!client_factory)
|
if (!client_factory)
|
||||||
|
_LOGW(AF_UNSPEC, "init: unknown DHCP client '%s', ignoring", client);
|
||||||
|
else if (!(client_factory = _client_factory_available(client_factory)))
|
||||||
_LOGW(AF_UNSPEC, "init: DHCP client '%s' not available", client);
|
_LOGW(AF_UNSPEC, "init: DHCP client '%s' not available", client);
|
||||||
}
|
}
|
||||||
if (!client_factory) {
|
if (!client_factory) {
|
||||||
|
|
|
||||||
|
|
@ -371,7 +371,7 @@ _ASSERT_dns_config_ip_data(const NMDnsConfigIPData *ip_data)
|
||||||
gboolean has_default = FALSE;
|
gboolean has_default = FALSE;
|
||||||
gsize i;
|
gsize i;
|
||||||
|
|
||||||
for (i = 0; ip_data->domains.search && ip_data->domains.search; i++) {
|
for (i = 0; ip_data->domains.search && ip_data->domains.search[i]; i++) {
|
||||||
const char *d = ip_data->domains.search[i];
|
const char *d = ip_data->domains.search[i];
|
||||||
|
|
||||||
d = nm_utils_parse_dns_domain(d, NULL);
|
d = nm_utils_parse_dns_domain(d, NULL);
|
||||||
|
|
|
||||||
|
|
@ -1257,34 +1257,28 @@ read_base_config(GKeyFile *keyfile,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We want to use GDir instead of GFile here to avoid loading GVFS modules and
|
||||||
|
* initalizing DBUS infra for communicating with GVFS.
|
||||||
|
* https://redhat.atlassian.net/browse/RHEL-140113
|
||||||
|
*/
|
||||||
static GPtrArray *
|
static GPtrArray *
|
||||||
_get_config_dir_files(const char *config_dir)
|
_get_config_dir_files(const char *config_dir)
|
||||||
{
|
{
|
||||||
GFile *dir;
|
GDir *dir;
|
||||||
GFileEnumerator *direnum;
|
GPtrArray *confs;
|
||||||
GFileInfo *info;
|
const char *name;
|
||||||
GPtrArray *confs;
|
|
||||||
const char *name;
|
|
||||||
|
|
||||||
g_return_val_if_fail(config_dir, NULL);
|
g_return_val_if_fail(config_dir, NULL);
|
||||||
|
|
||||||
confs = g_ptr_array_new_with_free_func(g_free);
|
confs = g_ptr_array_new_with_free_func(g_free);
|
||||||
if (!*config_dir)
|
if (!*config_dir)
|
||||||
return confs;
|
return confs;
|
||||||
|
dir = g_dir_open(config_dir, 0, NULL);
|
||||||
dir = g_file_new_for_path(config_dir);
|
if (dir) {
|
||||||
direnum = g_file_enumerate_children(dir, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, NULL);
|
while ((name = g_dir_read_name(dir))) {
|
||||||
if (direnum) {
|
|
||||||
while ((info = g_file_enumerator_next_file(direnum, NULL, NULL))) {
|
|
||||||
name = g_file_info_get_name(info);
|
|
||||||
if (NM_STR_HAS_SUFFIX(name, ".conf"))
|
if (NM_STR_HAS_SUFFIX(name, ".conf"))
|
||||||
g_ptr_array_add(confs, g_strdup(name));
|
g_ptr_array_add(confs, g_strdup(name));
|
||||||
g_object_unref(info);
|
|
||||||
}
|
}
|
||||||
g_object_unref(direnum);
|
g_dir_close(dir);
|
||||||
}
|
}
|
||||||
g_object_unref(dir);
|
|
||||||
|
|
||||||
g_ptr_array_sort(confs, nm_strcmp_p);
|
g_ptr_array_sort(confs, nm_strcmp_p);
|
||||||
return confs;
|
return confs;
|
||||||
}
|
}
|
||||||
|
|
@ -1340,8 +1334,7 @@ read_entire_config(const NMConfigCmdLineOptions *cli,
|
||||||
run_config_dir = RUN_CONFIG_DIR;
|
run_config_dir = RUN_CONFIG_DIR;
|
||||||
|
|
||||||
/* create a default configuration file. */
|
/* create a default configuration file. */
|
||||||
keyfile = nm_config_create_keyfile();
|
keyfile = nm_config_create_keyfile();
|
||||||
|
|
||||||
system_confs = _get_config_dir_files(system_config_dir);
|
system_confs = _get_config_dir_files(system_config_dir);
|
||||||
confs = _get_config_dir_files(config_dir);
|
confs = _get_config_dir_files(config_dir);
|
||||||
run_confs = _get_config_dir_files(run_config_dir);
|
run_confs = _get_config_dir_files(run_config_dir);
|
||||||
|
|
@ -3293,7 +3286,6 @@ init_sync(GInitable *initable, GCancellable *cancellable, GError **error)
|
||||||
g_set_error(error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND, "unspecified error");
|
g_set_error(error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND, "unspecified error");
|
||||||
g_return_val_if_reached(FALSE);
|
g_return_val_if_reached(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
s = priv->cli.config_dir ?: "" DEFAULT_CONFIG_DIR;
|
s = priv->cli.config_dir ?: "" DEFAULT_CONFIG_DIR;
|
||||||
priv->config_dir = g_strdup(s[0] == '/' ? s : "");
|
priv->config_dir = g_strdup(s[0] == '/' ? s : "");
|
||||||
|
|
||||||
|
|
@ -3301,12 +3293,10 @@ init_sync(GInitable *initable, GCancellable *cancellable, GError **error)
|
||||||
if (s[0] != '/' || nm_streq(s, priv->config_dir))
|
if (s[0] != '/' || nm_streq(s, priv->config_dir))
|
||||||
s = "";
|
s = "";
|
||||||
priv->system_config_dir = g_strdup(s);
|
priv->system_config_dir = g_strdup(s);
|
||||||
|
|
||||||
if (priv->cli.intern_config_file)
|
if (priv->cli.intern_config_file)
|
||||||
priv->intern_config_file = g_strdup(priv->cli.intern_config_file);
|
priv->intern_config_file = g_strdup(priv->cli.intern_config_file);
|
||||||
else
|
else
|
||||||
priv->intern_config_file = g_strdup(DEFAULT_INTERN_CONFIG_FILE);
|
priv->intern_config_file = g_strdup(DEFAULT_INTERN_CONFIG_FILE);
|
||||||
|
|
||||||
warnings = g_ptr_array_new_with_free_func(g_free);
|
warnings = g_ptr_array_new_with_free_func(g_free);
|
||||||
|
|
||||||
keyfile = read_entire_config(&priv->cli,
|
keyfile = read_entire_config(&priv->cli,
|
||||||
|
|
|
||||||
|
|
@ -4140,6 +4140,7 @@ update_routes:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_CLAT
|
||||||
/**
|
/**
|
||||||
* _clat_prefix_is_better:
|
* _clat_prefix_is_better:
|
||||||
* @best: current best candidate (or %NULL)
|
* @best: current best candidate (or %NULL)
|
||||||
|
|
@ -4186,6 +4187,7 @@ _clat_prefix_is_better(const NMPlatformIP6Address *best,
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_CLAT */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_l3cfg_update_clat_config(NML3Cfg *self,
|
_l3cfg_update_clat_config(NML3Cfg *self,
|
||||||
|
|
|
||||||
|
|
@ -8146,6 +8146,27 @@ nm_manager_start(NMManager *self, GError **error)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
compare_device_remove_order(const CList *a, const CList *b, const void *user_data)
|
||||||
|
{
|
||||||
|
NMDevice *dev_a = c_list_entry(a, NMDevice, devices_lst);
|
||||||
|
NMDevice *dev_b = c_list_entry(b, NMDevice, devices_lst);
|
||||||
|
|
||||||
|
gboolean a_has_dhcp =
|
||||||
|
nm_device_get_dhcp_config(dev_a, AF_INET) || nm_device_get_dhcp_config(dev_a, AF_INET6);
|
||||||
|
gboolean b_has_dhcp =
|
||||||
|
nm_device_get_dhcp_config(dev_b, AF_INET) || nm_device_get_dhcp_config(dev_b, AF_INET6);
|
||||||
|
gboolean a_is_software = nm_device_is_software(dev_a);
|
||||||
|
gboolean b_is_software = nm_device_is_software(dev_b);
|
||||||
|
|
||||||
|
/* priority: software AND dhcp first, then dhcp only
|
||||||
|
* then everything else,*/
|
||||||
|
int a_score = a_has_dhcp ? (a_is_software ? 2 : 1) : 0;
|
||||||
|
int b_score = b_has_dhcp ? (b_is_software ? 2 : 1) : 0;
|
||||||
|
|
||||||
|
return b_score - a_score;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nm_manager_stop(NMManager *self)
|
nm_manager_stop(NMManager *self)
|
||||||
{
|
{
|
||||||
|
|
@ -8167,6 +8188,12 @@ nm_manager_stop(NMManager *self)
|
||||||
|
|
||||||
nm_dbus_manager_stop(nm_dbus_object_get_manager(NM_DBUS_OBJECT(self)));
|
nm_dbus_manager_stop(nm_dbus_object_get_manager(NM_DBUS_OBJECT(self)));
|
||||||
|
|
||||||
|
/* When OVS internal interface or linux bridge holds DHCP, if we delete its
|
||||||
|
* physical interface first, then we cannot send out DHCP release request
|
||||||
|
* anymore. To fix that, we need to remove/deactivate software interfaces that
|
||||||
|
* holds DHCP config first.
|
||||||
|
*/
|
||||||
|
c_list_sort(&priv->devices_lst_head, compare_device_remove_order, NULL);
|
||||||
while ((device = c_list_first_entry(&priv->devices_lst_head, NMDevice, devices_lst)))
|
while ((device = c_list_first_entry(&priv->devices_lst_head, NMDevice, devices_lst)))
|
||||||
remove_device(self, device, TRUE);
|
remove_device(self, device, TRUE);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ ip6_subnet_from_delegation(IP6PrefixDelegation *delegation, NMDevice *device)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for out-of-prefixes condition */
|
/* Check for out-of-prefixes condition */
|
||||||
num_subnets = 1 << (64 - delegation->prefix.plen);
|
num_subnets = (guint64) 1 << (64 - delegation->prefix.plen);
|
||||||
if (nm_g_hash_table_size(delegation->map_subnet_id_to_ifindex) >= num_subnets) {
|
if (nm_g_hash_table_size(delegation->map_subnet_id_to_ifindex) >= num_subnets) {
|
||||||
_LOGD(LOGD_IP6,
|
_LOGD(LOGD_IP6,
|
||||||
"ipv6-pd: no more prefixes in %s/%u",
|
"ipv6-pd: no more prefixes in %s/%u",
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ nm_ip_up(void *data, int arg)
|
||||||
g_variant_builder_add(&builder,
|
g_variant_builder_add(&builder,
|
||||||
"{sv}",
|
"{sv}",
|
||||||
NM_PPP_IP4_CONFIG_GATEWAY,
|
NM_PPP_IP4_CONFIG_GATEWAY,
|
||||||
g_variant_new_uint32(peer_opts.ouraddr));
|
g_variant_new_uint32(peer_opts.hisaddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
g_variant_builder_add(&builder, "{sv}", NM_PPP_IP4_CONFIG_PREFIX, g_variant_new_uint32(32));
|
g_variant_builder_add(&builder, "{sv}", NM_PPP_IP4_CONFIG_PREFIX, g_variant_new_uint32(32));
|
||||||
|
|
|
||||||
|
|
@ -167,13 +167,13 @@ if enable_introspection
|
||||||
install: true,
|
install: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
gi_typelib_path = run_command('printenv', 'GI_TYPELIB_PATH', check: false).stdout()
|
gi_typelib_path = run_command('printenv', 'GI_TYPELIB_PATH', check: false).stdout().strip()
|
||||||
if gi_typelib_path != ''
|
if gi_typelib_path != ''
|
||||||
gi_typelib_path = ':' + gi_typelib_path
|
gi_typelib_path = ':' + gi_typelib_path
|
||||||
endif
|
endif
|
||||||
gi_typelib_path = meson.current_build_dir() + gi_typelib_path
|
gi_typelib_path = meson.current_build_dir() + gi_typelib_path
|
||||||
|
|
||||||
ld_library_path = run_command('printenv', 'LD_LIBRARY_PATH', check: false).stdout()
|
ld_library_path = run_command('printenv', 'LD_LIBRARY_PATH', check: false).stdout().strip()
|
||||||
if ld_library_path != ''
|
if ld_library_path != ''
|
||||||
ld_library_path = ':' + ld_library_path
|
ld_library_path = ':' + ld_library_path
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ static NM_UTILS_STRING_TABLE_LOOKUP_STRUCT_DEFINE(
|
||||||
{"any", NM_BOND_OPTION_TYPE_BOTH, 0, 1, _option_default_strv_arp_all_targets}},
|
{"any", NM_BOND_OPTION_TYPE_BOTH, 0, 1, _option_default_strv_arp_all_targets}},
|
||||||
{NM_SETTING_BOND_OPTION_ARP_INTERVAL, {"0", NM_BOND_OPTION_TYPE_INT, 0, G_MAXINT}},
|
{NM_SETTING_BOND_OPTION_ARP_INTERVAL, {"0", NM_BOND_OPTION_TYPE_INT, 0, G_MAXINT}},
|
||||||
{NM_SETTING_BOND_OPTION_ARP_IP_TARGET, {"", NM_BOND_OPTION_TYPE_IP}},
|
{NM_SETTING_BOND_OPTION_ARP_IP_TARGET, {"", NM_BOND_OPTION_TYPE_IP}},
|
||||||
{NM_SETTING_BOND_OPTION_ARP_MISSED_MAX, {"0", NM_BOND_OPTION_TYPE_INT, 0, 255}},
|
{NM_SETTING_BOND_OPTION_ARP_MISSED_MAX, {"2", NM_BOND_OPTION_TYPE_INT, 0, 255}},
|
||||||
{NM_SETTING_BOND_OPTION_ARP_VALIDATE,
|
{NM_SETTING_BOND_OPTION_ARP_VALIDATE,
|
||||||
{"none", NM_BOND_OPTION_TYPE_BOTH, 0, 6, _option_default_strv_arp_validate}},
|
{"none", NM_BOND_OPTION_TYPE_BOTH, 0, 6, _option_default_strv_arp_validate}},
|
||||||
{NM_SETTING_BOND_OPTION_BALANCE_SLB, {"0", NM_BOND_OPTION_TYPE_INT, 0, 1}},
|
{NM_SETTING_BOND_OPTION_BALANCE_SLB, {"0", NM_BOND_OPTION_TYPE_INT, 0, 1}},
|
||||||
|
|
@ -364,6 +364,10 @@ _bond_get_option_normalized(NMSettingBond *self, const char *option, gboolean ge
|
||||||
/* balance-slb implies vlan+srcmac */
|
/* balance-slb implies vlan+srcmac */
|
||||||
return "5";
|
return "5";
|
||||||
}
|
}
|
||||||
|
} else if (nm_streq(option, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX)) {
|
||||||
|
value = _bond_get_option(self, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX) ?: "0";
|
||||||
|
if (nm_streq(value, "0"))
|
||||||
|
value = _bond_get_option_default(self, option);
|
||||||
} else
|
} else
|
||||||
value = _bond_get_option(self, option);
|
value = _bond_get_option(self, option);
|
||||||
|
|
||||||
|
|
@ -894,13 +898,16 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
|
|
||||||
miimon = _atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_MIIMON));
|
miimon = _atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_MIIMON));
|
||||||
arp_interval = _atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_ARP_INTERVAL));
|
arp_interval = _atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_ARP_INTERVAL));
|
||||||
arp_missed_max =
|
|
||||||
_atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX));
|
|
||||||
num_grat_arp = _atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP));
|
num_grat_arp = _atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP));
|
||||||
num_unsol_na = _atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_NUM_UNSOL_NA));
|
num_unsol_na = _atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_NUM_UNSOL_NA));
|
||||||
peer_notif_delay =
|
peer_notif_delay =
|
||||||
_atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_PEER_NOTIF_DELAY));
|
_atoi(_bond_get_option_or_default(self, NM_SETTING_BOND_OPTION_PEER_NOTIF_DELAY));
|
||||||
|
|
||||||
|
/* "0" is an invalid value in the kernel, but we used to accept it to indicate "default value".
|
||||||
|
* Keep accepting "0" as a valid value, although we'll apply a different value, actually.
|
||||||
|
* Bond modes that don't accept arp_missed_max must just ignore the "0" value, too. */
|
||||||
|
arp_missed_max = _atoi(_bond_get_option(self, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX) ?: "0");
|
||||||
|
|
||||||
/* Option restrictions:
|
/* Option restrictions:
|
||||||
*
|
*
|
||||||
* arp_interval conflicts [ alb, tlb ]
|
* arp_interval conflicts [ alb, tlb ]
|
||||||
|
|
@ -950,6 +957,9 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
g_prefix_error(error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
|
g_prefix_error(error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NM_IN_SET(bond_mode, NM_BOND_MODE_TLB, NM_BOND_MODE_ALB, NM_BOND_MODE_8023AD)) {
|
||||||
if (arp_missed_max > 0) {
|
if (arp_missed_max > 0) {
|
||||||
g_set_error(error,
|
g_set_error(error,
|
||||||
NM_CONNECTION_ERROR,
|
NM_CONNECTION_ERROR,
|
||||||
|
|
|
||||||
|
|
@ -1401,7 +1401,7 @@ _ip_route_attribute_validate(const char *name,
|
||||||
NM_CONNECTION_ERROR_FAILED,
|
NM_CONNECTION_ERROR_FAILED,
|
||||||
family == AF_INET ? _("'%s' is not a valid IPv4 address")
|
family == AF_INET ? _("'%s' is not a valid IPv4 address")
|
||||||
: _("'%s' is not a valid IPv6 address"),
|
: _("'%s' is not a valid IPv6 address"),
|
||||||
string);
|
addr);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -6960,7 +6960,7 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass)
|
||||||
* activation will fail. The property is currently implemented only for IPv4.
|
* activation will fail. The property is currently implemented only for IPv4.
|
||||||
*
|
*
|
||||||
* A zero value means that no duplicate address detection is performed, -1 means
|
* A zero value means that no duplicate address detection is performed, -1 means
|
||||||
* the default value (either the value configured globally in NetworkManger.conf
|
* the default value (either the value configured globally in NetworkManager.conf
|
||||||
* or 200ms). A value greater than zero is a timeout in milliseconds. Note that
|
* or 200ms). A value greater than zero is a timeout in milliseconds. Note that
|
||||||
* the time intervals are subject to randomization as per RFC 5227 and so the
|
* the time intervals are subject to randomization as per RFC 5227 and so the
|
||||||
* actual duration can be between half and the full time specified in this
|
* actual duration can be between half and the full time specified in this
|
||||||
|
|
@ -7006,7 +7006,7 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass)
|
||||||
* This property is useful for example if both IPv4 and IPv6 are enabled and
|
* This property is useful for example if both IPv4 and IPv6 are enabled and
|
||||||
* are allowed to fail. Normally the connection succeeds as soon as one of
|
* are allowed to fail. Normally the connection succeeds as soon as one of
|
||||||
* the two address families completes; by setting a required timeout for
|
* the two address families completes; by setting a required timeout for
|
||||||
* e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4,
|
* e.g. IPv4, one can ensure that even if IPv6 succeeds earlier than IPv4,
|
||||||
* NetworkManager waits some time for IPv4 before the connection becomes
|
* NetworkManager waits some time for IPv4 before the connection becomes
|
||||||
* active.
|
* active.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1282,7 +1282,7 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
||||||
* won't get merged. If the route finds no merge partner, it is
|
* won't get merged. If the route finds no merge partner, it is
|
||||||
* configured as single hop route.</para> <para>Note that in
|
* configured as single hop route.</para> <para>Note that in
|
||||||
* NetworkManager, currently all nexthops of a ECMP route must share
|
* NetworkManager, currently all nexthops of a ECMP route must share
|
||||||
* the same "onlink" flag in order to be mergable.</para>
|
* the same "onlink" flag in order to be mergeable.</para>
|
||||||
* </listitem>
|
* </listitem>
|
||||||
* <listitem>
|
* <listitem>
|
||||||
* <para><literal>"window"</literal> - an unsigned 32 bit integer.</para>
|
* <para><literal>"window"</literal> - an unsigned 32 bit integer.</para>
|
||||||
|
|
|
||||||
|
|
@ -4082,13 +4082,12 @@ test_roundtrip_conversion(gconstpointer test_data)
|
||||||
if (flag == NM_CONNECTION_SERIALIZE_ALL) {
|
if (flag == NM_CONNECTION_SERIALIZE_ALL) {
|
||||||
s_wg2 = NM_SETTING_WIREGUARD(
|
s_wg2 = NM_SETTING_WIREGUARD(
|
||||||
nm_connection_get_setting(con2, NM_TYPE_SETTING_WIREGUARD));
|
nm_connection_get_setting(con2, NM_TYPE_SETTING_WIREGUARD));
|
||||||
|
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, TRUE, TRUE, FALSE);
|
||||||
if (flag == NM_CONNECTION_SERIALIZE_ALL)
|
} else if (flag == NM_CONNECTION_SERIALIZE_WITH_NON_SECRET) {
|
||||||
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, TRUE, TRUE, FALSE);
|
con2 = _connection_new_from_dbus_strict(con_var, FALSE);
|
||||||
else if (flag == NM_CONNECTION_SERIALIZE_WITH_NON_SECRET)
|
s_wg2 = NM_SETTING_WIREGUARD(
|
||||||
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, FALSE, FALSE, TRUE);
|
nm_connection_get_setting(con2, NM_TYPE_SETTING_WIREGUARD));
|
||||||
else
|
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, FALSE, FALSE, TRUE);
|
||||||
g_assert_not_reached();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -5533,7 +5532,7 @@ test_bond_meta(void)
|
||||||
_A(_nm_setting_bond_opt_value_as_u16, set, NM_SETTING_BOND_OPTION_AD_ACTOR_SYS_PRIO, 0, EINVAL);
|
_A(_nm_setting_bond_opt_value_as_u16, set, NM_SETTING_BOND_OPTION_AD_ACTOR_SYS_PRIO, 0, EINVAL);
|
||||||
_A(_nm_setting_bond_opt_value_as_u16, set, NM_SETTING_BOND_OPTION_AD_USER_PORT_KEY, 0, EINVAL);
|
_A(_nm_setting_bond_opt_value_as_u16, set, NM_SETTING_BOND_OPTION_AD_USER_PORT_KEY, 0, EINVAL);
|
||||||
_A(_nm_setting_bond_opt_value_as_u8, set, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP, 1, 0);
|
_A(_nm_setting_bond_opt_value_as_u8, set, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP, 1, 0);
|
||||||
_A(_nm_setting_bond_opt_value_as_u8, set, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX, 0, 0);
|
_A(_nm_setting_bond_opt_value_as_u8, set, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX, 2, 0);
|
||||||
_A(_nm_setting_bond_opt_value_as_u8, set, NM_SETTING_BOND_OPTION_ALL_SLAVES_ACTIVE, 0, 0);
|
_A(_nm_setting_bond_opt_value_as_u8, set, NM_SETTING_BOND_OPTION_ALL_SLAVES_ACTIVE, 0, 0);
|
||||||
_A(_nm_setting_bond_opt_value_as_intbool, set, NM_SETTING_BOND_OPTION_USE_CARRIER, 1, 0);
|
_A(_nm_setting_bond_opt_value_as_intbool, set, NM_SETTING_BOND_OPTION_USE_CARRIER, 1, 0);
|
||||||
_A(_nm_setting_bond_opt_value_as_intbool,
|
_A(_nm_setting_bond_opt_value_as_intbool,
|
||||||
|
|
|
||||||
|
|
@ -1766,8 +1766,12 @@ _parse_lnk_bond(const char *kind, struct nlattr *info_data)
|
||||||
props->num_grat_arp = nla_get_u8(tb[IFLA_BOND_NUM_PEER_NOTIF]);
|
props->num_grat_arp = nla_get_u8(tb[IFLA_BOND_NUM_PEER_NOTIF]);
|
||||||
if (tb[IFLA_BOND_ALL_PORTS_ACTIVE])
|
if (tb[IFLA_BOND_ALL_PORTS_ACTIVE])
|
||||||
props->all_ports_active = nla_get_u8(tb[IFLA_BOND_ALL_PORTS_ACTIVE]);
|
props->all_ports_active = nla_get_u8(tb[IFLA_BOND_ALL_PORTS_ACTIVE]);
|
||||||
if (tb[IFLA_BOND_MISSED_MAX])
|
if (tb[IFLA_BOND_MISSED_MAX]) {
|
||||||
props->arp_missed_max = nla_get_u8(tb[IFLA_BOND_MISSED_MAX]);
|
props->arp_missed_max = nla_get_u8(tb[IFLA_BOND_MISSED_MAX]);
|
||||||
|
props->arp_missed_max_has = TRUE;
|
||||||
|
} else {
|
||||||
|
props->arp_missed_max_has = FALSE;
|
||||||
|
}
|
||||||
if (tb[IFLA_BOND_MIN_LINKS])
|
if (tb[IFLA_BOND_MIN_LINKS])
|
||||||
props->min_links = nla_get_u32(tb[IFLA_BOND_MIN_LINKS]);
|
props->min_links = nla_get_u32(tb[IFLA_BOND_MIN_LINKS]);
|
||||||
if (tb[IFLA_BOND_LP_INTERVAL])
|
if (tb[IFLA_BOND_LP_INTERVAL])
|
||||||
|
|
@ -5126,7 +5130,7 @@ _nl_msg_new_link_set_linkinfo(struct nl_msg *msg, NMLinkType link_type, gconstpo
|
||||||
&props->ad_actor_system);
|
&props->ad_actor_system);
|
||||||
if (props->ad_select)
|
if (props->ad_select)
|
||||||
NLA_PUT_U8(msg, IFLA_BOND_AD_SELECT, props->ad_select);
|
NLA_PUT_U8(msg, IFLA_BOND_AD_SELECT, props->ad_select);
|
||||||
if (props->arp_missed_max)
|
if (props->arp_missed_max_has)
|
||||||
NLA_PUT_U8(msg, IFLA_BOND_MISSED_MAX, props->arp_missed_max);
|
NLA_PUT_U8(msg, IFLA_BOND_MISSED_MAX, props->arp_missed_max);
|
||||||
|
|
||||||
NLA_PUT_U8(msg, IFLA_BOND_ALL_PORTS_ACTIVE, props->all_ports_active);
|
NLA_PUT_U8(msg, IFLA_BOND_ALL_PORTS_ACTIVE, props->all_ports_active);
|
||||||
|
|
|
||||||
|
|
@ -6373,6 +6373,7 @@ nm_platform_lnk_bond_to_string(const NMPlatformLnkBond *lnk, char *buf, gsize le
|
||||||
char sbuf_resend_igmp[30];
|
char sbuf_resend_igmp[30];
|
||||||
char sbuf_lp_interval[30];
|
char sbuf_lp_interval[30];
|
||||||
char sbuf_tlb_dynamic_lb[30];
|
char sbuf_tlb_dynamic_lb[30];
|
||||||
|
char sbuf_arp_missed_max[30];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!nm_utils_to_string_buffer_init_null(lnk, &buf, &len))
|
if (!nm_utils_to_string_buffer_init_null(lnk, &buf, &len))
|
||||||
|
|
@ -6403,7 +6404,7 @@ nm_platform_lnk_bond_to_string(const NMPlatformLnkBond *lnk, char *buf, gsize le
|
||||||
" xmit_hash_policy %u"
|
" xmit_hash_policy %u"
|
||||||
" num_gray_arp %u"
|
" num_gray_arp %u"
|
||||||
" all_ports_active %u"
|
" all_ports_active %u"
|
||||||
" arp_missed_max %u"
|
"%s" /* arp_missed_max %u */
|
||||||
" lacp_rate %u"
|
" lacp_rate %u"
|
||||||
"%s" /* lacp_active */
|
"%s" /* lacp_active */
|
||||||
" ad_select %u"
|
" ad_select %u"
|
||||||
|
|
@ -6455,7 +6456,12 @@ nm_platform_lnk_bond_to_string(const NMPlatformLnkBond *lnk, char *buf, gsize le
|
||||||
lnk->xmit_hash_policy,
|
lnk->xmit_hash_policy,
|
||||||
lnk->num_grat_arp,
|
lnk->num_grat_arp,
|
||||||
lnk->all_ports_active,
|
lnk->all_ports_active,
|
||||||
lnk->arp_missed_max,
|
lnk->arp_missed_max_has || lnk->arp_missed_max != 0
|
||||||
|
? nm_sprintf_buf(sbuf_arp_missed_max,
|
||||||
|
" arp_missed_max%s %u",
|
||||||
|
!lnk->arp_missed_max_has ? "?" : "",
|
||||||
|
(int) lnk->arp_missed_max)
|
||||||
|
: "",
|
||||||
lnk->lacp_rate,
|
lnk->lacp_rate,
|
||||||
lnk->lacp_active_has || lnk->lacp_active != 0
|
lnk->lacp_active_has || lnk->lacp_active != 0
|
||||||
? nm_sprintf_buf(sbuf_lacp_active,
|
? nm_sprintf_buf(sbuf_lacp_active,
|
||||||
|
|
@ -8388,7 +8394,8 @@ nm_platform_lnk_bond_hash_update(const NMPlatformLnkBond *obj, NMHashState *h)
|
||||||
obj->tlb_dynamic_lb,
|
obj->tlb_dynamic_lb,
|
||||||
obj->tlb_dynamic_lb_has,
|
obj->tlb_dynamic_lb_has,
|
||||||
obj->updelay_has,
|
obj->updelay_has,
|
||||||
obj->use_carrier));
|
obj->use_carrier,
|
||||||
|
obj->arp_missed_max_has));
|
||||||
|
|
||||||
nm_hash_update(h, obj->arp_ip_target, obj->arp_ip_targets_num * sizeof(obj->arp_ip_target[0]));
|
nm_hash_update(h, obj->arp_ip_target, obj->arp_ip_targets_num * sizeof(obj->arp_ip_target[0]));
|
||||||
nm_hash_update(h, obj->ns_ip6_target, obj->ns_ip6_targets_num * sizeof(obj->ns_ip6_target[0]));
|
nm_hash_update(h, obj->ns_ip6_target, obj->ns_ip6_targets_num * sizeof(obj->ns_ip6_target[0]));
|
||||||
|
|
@ -8466,6 +8473,7 @@ nm_platform_lnk_bond_cmp(const NMPlatformLnkBond *a, const NMPlatformLnkBond *b)
|
||||||
NM_CMP_FIELD_BOOL(a, b, tlb_dynamic_lb_has);
|
NM_CMP_FIELD_BOOL(a, b, tlb_dynamic_lb_has);
|
||||||
NM_CMP_FIELD_BOOL(a, b, updelay_has);
|
NM_CMP_FIELD_BOOL(a, b, updelay_has);
|
||||||
NM_CMP_FIELD_BOOL(a, b, use_carrier);
|
NM_CMP_FIELD_BOOL(a, b, use_carrier);
|
||||||
|
NM_CMP_FIELD_BOOL(a, b, arp_missed_max_has);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -840,6 +840,7 @@ typedef struct {
|
||||||
bool tlb_dynamic_lb_has : 1;
|
bool tlb_dynamic_lb_has : 1;
|
||||||
bool updelay_has : 1;
|
bool updelay_has : 1;
|
||||||
bool use_carrier : 1;
|
bool use_carrier : 1;
|
||||||
|
bool arp_missed_max_has : 1;
|
||||||
} _nm_alignas(NMPlatformObject) NMPlatformLnkBond;
|
} _nm_alignas(NMPlatformObject) NMPlatformLnkBond;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
||||||
|
|
@ -3845,7 +3845,7 @@ _objlist_set_fcn_ovs_port_trunks(NMSetting *setting,
|
||||||
NM_UTILS_ERROR_INVALID_ARGUMENT,
|
NM_UTILS_ERROR_INVALID_ARGUMENT,
|
||||||
"%s. %s",
|
"%s. %s",
|
||||||
local->message,
|
local->message,
|
||||||
_("The valid syntax is: '<value>' or '<start>-<end>"));
|
_("The valid syntax is: '<value>' or '<start>-<end>'"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4928,7 +4928,7 @@ static const NMMetaPropertyType _pt_objlist = {
|
||||||
((guint32 (*) (NMSetting *)) ((sizeof (func == ((guint32 (*) (type *)) func))) ? func : func) )
|
((guint32 (*) (NMSetting *)) ((sizeof (func == ((guint32 (*) (type *)) func))) ? func : func) )
|
||||||
|
|
||||||
#define TEAM_DESCRIBE_MESSAGE \
|
#define TEAM_DESCRIBE_MESSAGE \
|
||||||
N_("nmcli can accepts both direct JSON configuration data and a file name containing " \
|
N_("nmcli can accept both direct JSON configuration data and a file name containing " \
|
||||||
"the configuration. In the latter case the file is read and the contents is put " \
|
"the configuration. In the latter case the file is read and the contents is put " \
|
||||||
"into this property.\n\n" \
|
"into this property.\n\n" \
|
||||||
"Examples: set team.config " \
|
"Examples: set team.config " \
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ADDRESSES N_("A list of IPv4 addresses and their prefix length. Multiple addresses can be separated by comma. For example \"192.168.1.5/24, 10.1.0.5/24\". The addresses are listed in decreasing priority, meaning the first address will be the primary address.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ADDRESSES N_("A list of IPv4 addresses and their prefix length. Multiple addresses can be separated by comma. For example \"192.168.1.5/24, 10.1.0.5/24\". The addresses are listed in decreasing priority, meaning the first address will be the primary address.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_AUTO_ROUTE_EXT_GW N_("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.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_AUTO_ROUTE_EXT_GW N_("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.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_CLAT N_("Controls the CLAT (Customer-side translator) functionality. CLAT is used to implement the client part of 464XLAT (RFC 6877), an architecture that provides IPv4 connectivity to hosts on IPv6-only networks. When CLAT is enabled, NetworkManager discovers the NAT64 prefix from IPv6 Router Advertisements; if a NAT64 prefix is announced, NetworkManager installs a BPF program to perform the stateless translation of packets between IPv4 and IPv6. Setting \"no\" (0) completely disables CLAT. \"auto\" (1) enables CLAT only when the IPv4 method is 'auto' and the device doesn't have a native IPv4 gateway. \"force\" (2) enables CLAT even if the IPv4 method is not 'auto' and even if the device has a native IPv4 gateway. When set to \"default\" (-1), the actual value is looked up in the global configuration; if not specified it defaults to \"no\" (0). In the future the default fall back value will change to \"auto\" (1).")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_CLAT N_("Controls the CLAT (Customer-side translator) functionality. CLAT is used to implement the client part of 464XLAT (RFC 6877), an architecture that provides IPv4 connectivity to hosts on IPv6-only networks. When CLAT is enabled, NetworkManager discovers the NAT64 prefix from IPv6 Router Advertisements; if a NAT64 prefix is announced, NetworkManager installs a BPF program to perform the stateless translation of packets between IPv4 and IPv6. Setting \"no\" (0) completely disables CLAT. \"auto\" (1) enables CLAT only when the IPv4 method is 'auto' and the device doesn't have a native IPv4 gateway. \"force\" (2) enables CLAT even if the IPv4 method is not 'auto' and even if the device has a native IPv4 gateway. When set to \"default\" (-1), the actual value is looked up in the global configuration; if not specified it defaults to \"no\" (0). In the future the default fall back value will change to \"auto\" (1).")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DAD_TIMEOUT N_("Maximum timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. The property is currently implemented only for IPv4. A zero value means that no duplicate address detection is performed, -1 means the default value (either the value configured globally in NetworkManger.conf or 200ms). A value greater than zero is a timeout in milliseconds. Note that the time intervals are subject to randomization as per RFC 5227 and so the actual duration can be between half and the full time specified in this property.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DAD_TIMEOUT N_("Maximum timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. The property is currently implemented only for IPv4. A zero value means that no duplicate address detection is performed, -1 means the default value (either the value configured globally in NetworkManager.conf or 200ms). A value greater than zero is a timeout in milliseconds. Note that the time intervals are subject to randomization as per RFC 5227 and so the actual duration can be between half and the full time specified in this property.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID N_("A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string ('aa:bb:cc') it is interpreted as a binary client ID, in which case the first byte is assumed to be the 'type' field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. '01:xx:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the 'type' field is set to 0. The special values \"mac\" and \"perm-mac\" are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet (01). Currently, these options only work for ethernet type of links. The special value \"ipv6-duid\" uses the DUID from \"ipv6.dhcp-duid\" property as an RFC4361-compliant client identifier. As IAID it uses \"ipv4.dhcp-iaid\" and falls back to \"ipv6.dhcp-iaid\" if unset. The special value \"duid\" generates a RFC4361-compliant client identifier based on \"ipv4.dhcp-iaid\" and uses a DUID generated by hashing /etc/machine-id. The special value \"stable\" is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id) and a per-host key. If you set the stable-id, you may want to include the \"${DEVICE}\" or \"${MAC}\" specifier to get a per-device key. The special value \"none\" prevents any client identifier from being sent. Note that this is normally not recommended. If unset, a globally configured default from NetworkManager.conf is used. If still unset, the default depends on the DHCP plugin. The internal dhcp client will default to \"mac\" and the dhclient plugin will try to use one from its config file if present, or won't sent any client-id otherwise.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID N_("A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string ('aa:bb:cc') it is interpreted as a binary client ID, in which case the first byte is assumed to be the 'type' field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. '01:xx:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the 'type' field is set to 0. The special values \"mac\" and \"perm-mac\" are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet (01). Currently, these options only work for ethernet type of links. The special value \"ipv6-duid\" uses the DUID from \"ipv6.dhcp-duid\" property as an RFC4361-compliant client identifier. As IAID it uses \"ipv4.dhcp-iaid\" and falls back to \"ipv6.dhcp-iaid\" if unset. The special value \"duid\" generates a RFC4361-compliant client identifier based on \"ipv4.dhcp-iaid\" and uses a DUID generated by hashing /etc/machine-id. The special value \"stable\" is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id) and a per-host key. If you set the stable-id, you may want to include the \"${DEVICE}\" or \"${MAC}\" specifier to get a per-device key. The special value \"none\" prevents any client identifier from being sent. Note that this is normally not recommended. If unset, a globally configured default from NetworkManager.conf is used. If still unset, the default depends on the DHCP plugin. The internal dhcp client will default to \"mac\" and the dhclient plugin will try to use one from its config file if present, or won't sent any client-id otherwise.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_DSCP N_("Specifies the value for the DSCP field (traffic class) of the IP header. When empty, the global default value is used; if no global default is specified, it is assumed to be \"CS0\". Allowed values are: \"CS0\", \"CS4\" and \"CS6\". The property is currently valid only for IPv4, and it is supported only by the \"internal\" DHCP plugin.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_DSCP N_("Specifies the value for the DSCP field (traffic class) of the IP header. When empty, the global default value is used; if no global default is specified, it is assumed to be \"CS0\". Allowed values are: \"CS0\", \"CS4\" and \"CS6\". The property is currently valid only for IPv4, and it is supported only by the \"internal\" DHCP plugin.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_FQDN N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-hostname\" are mutually exclusive and cannot be set at the same time.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_FQDN N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-hostname\" are mutually exclusive and cannot be set at the same time.")
|
||||||
|
|
@ -214,7 +214,7 @@
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_METHOD N_("The IPv4 connection method.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_METHOD N_("The IPv4 connection method.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_NEVER_DEFAULT N_("If TRUE, this connection will never be the default connection for this IP type, meaning it will never be assigned the default route by NetworkManager.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_NEVER_DEFAULT N_("If TRUE, this connection will never be the default connection for this IP type, meaning it will never be assigned the default route by NetworkManager.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_REPLACE_LOCAL_RULE N_("Connections will default to keep the autogenerated priority 0 local rule unless this setting is set to TRUE.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_REPLACE_LOCAL_RULE N_("Connections will default to keep the autogenerated priority 0 local rule unless this setting is set to TRUE.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_REQUIRED_TIMEOUT N_("The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds. This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active. Note that if \"may-fail\" is FALSE for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout. A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero).")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_REQUIRED_TIMEOUT N_("The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds. This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IPv6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active. Note that if \"may-fail\" is FALSE for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout. A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero).")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_TABLE N_("Enable policy routing (source routing) and set the routing table used when adding routes. This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table. If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection. Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTE_TABLE N_("Enable policy routing (source routing) and set the routing table used when adding routes. This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table. If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection. Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTED_DNS N_("Whether to add routes for DNS servers. When enabled, NetworkManager adds a route for each DNS server that is associated with this connection either statically (defined in the connection profile) or dynamically (for example, retrieved via DHCP). The route guarantees that the DNS server is reached via this interface. When set to \"default\" (-1), the value from global configuration is used; if no global default is defined, this feature is disabled.")
|
#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_ROUTED_DNS N_("Whether to add routes for DNS servers. When enabled, NetworkManager adds a route for each DNS server that is associated with this connection either statically (defined in the connection profile) or dynamically (for example, retrieved via DHCP). The route guarantees that the DNS server is reached via this interface. When set to \"default\" (-1), the value from global configuration is used; if no global default is defined, this feature is disabled.")
|
||||||
|
|
@ -225,7 +225,7 @@
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE N_("Configure method for creating the IPv6 interface identifier 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.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE N_("Configure method for creating the IPv6 interface identifier 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.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDRESSES N_("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\". 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).")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ADDRESSES N_("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\". 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).")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_AUTO_ROUTE_EXT_GW N_("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.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_AUTO_ROUTE_EXT_GW N_("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.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DAD_TIMEOUT N_("Maximum timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. The property is currently implemented only for IPv4. A zero value means that no duplicate address detection is performed, -1 means the default value (either the value configured globally in NetworkManger.conf or 200ms). A value greater than zero is a timeout in milliseconds. Note that the time intervals are subject to randomization as per RFC 5227 and so the actual duration can be between half and the full time specified in this property.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DAD_TIMEOUT N_("Maximum timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. The property is currently implemented only for IPv4. A zero value means that no duplicate address detection is performed, -1 means the default value (either the value configured globally in NetworkManager.conf or 200ms). A value greater than zero is a timeout in milliseconds. Note that the time intervals are subject to randomization as per RFC 5227 and so the actual duration can be between half and the full time specified in this property.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_DSCP N_("Specifies the value for the DSCP field (traffic class) of the IP header. When empty, the global default value is used; if no global default is specified, it is assumed to be \"CS0\". Allowed values are: \"CS0\", \"CS4\" and \"CS6\". The property is currently valid only for IPv4, and it is supported only by the \"internal\" DHCP plugin.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_DSCP N_("Specifies the value for the DSCP field (traffic class) of the IP header. When empty, the global default value is used; if no global default is specified, it is assumed to be \"CS0\". Allowed values are: \"CS0\", \"CS4\" and \"CS6\". The property is currently valid only for IPv4, and it is supported only by the \"internal\" DHCP plugin.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_DUID N_("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 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. 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.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_DUID N_("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 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. 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.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DHCP_HOSTNAME N_("If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time.")
|
||||||
|
|
@ -252,7 +252,7 @@
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_NEVER_DEFAULT N_("If TRUE, this connection will never be the default connection for this IP type, meaning it will never be assigned the default route by NetworkManager.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_NEVER_DEFAULT N_("If TRUE, this connection will never be the default connection for this IP type, meaning it will never be assigned the default route by NetworkManager.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_RA_TIMEOUT N_("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.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_RA_TIMEOUT N_("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.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_REPLACE_LOCAL_RULE N_("Connections will default to keep the autogenerated priority 0 local rule unless this setting is set to TRUE.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_REPLACE_LOCAL_RULE N_("Connections will default to keep the autogenerated priority 0 local rule unless this setting is set to TRUE.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_REQUIRED_TIMEOUT N_("The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds. This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active. Note that if \"may-fail\" is FALSE for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout. A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero).")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_REQUIRED_TIMEOUT N_("The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds. This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IPv6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active. Note that if \"may-fail\" is FALSE for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout. A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero).")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_METRIC N_("The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_TABLE N_("Enable policy routing (source routing) and set the routing table used when adding routes. This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table. If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection. Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTE_TABLE N_("Enable policy routing (source routing) and set the routing table used when adding routes. This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table. If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection. Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.")
|
||||||
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTED_DNS N_("Whether to add routes for DNS servers. When enabled, NetworkManager adds a route for each DNS server that is associated with this connection either statically (defined in the connection profile) or dynamically (for example, retrieved via DHCP). The route guarantees that the DNS server is reached via this interface. When set to \"default\" (-1), the value from global configuration is used; if no global default is defined, this feature is disabled.")
|
#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_ROUTED_DNS N_("Whether to add routes for DNS servers. When enabled, NetworkManager adds a route for each DNS server that is associated with this connection either statically (defined in the connection profile) or dynamically (for example, retrieved via DHCP). The route guarantees that the DNS server is reached via this interface. When set to \"default\" (-1), the value from global configuration is used; if no global default is defined, this feature is disabled.")
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,7 @@ reader_read_all_connections_from_fw(Reader *reader, const char *sysfs_dir)
|
||||||
|
|
||||||
if (!nmi_ibft_update_connection_from_nic(connection, nic, &error)) {
|
if (!nmi_ibft_update_connection_from_nic(connection, nic, &error)) {
|
||||||
_LOGW(LOGD_CORE, "Unable to merge iBFT configuration: %s", error->message);
|
_LOGW(LOGD_CORE, "Unable to merge iBFT configuration: %s", error->message);
|
||||||
g_error_free(error);
|
g_clear_error(&error);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1469,12 +1469,12 @@
|
||||||
format="boolean"
|
format="boolean"
|
||||||
values="true/yes/on, false/no/off" />
|
values="true/yes/on, false/no/off" />
|
||||||
<property name="required-timeout"
|
<property name="required-timeout"
|
||||||
nmcli-description="The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds. This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active. Note that if "may-fail" is FALSE for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout. A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero)."
|
nmcli-description="The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds. This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IPv6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active. Note that if "may-fail" is FALSE for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout. A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero)."
|
||||||
format="integer"
|
format="integer"
|
||||||
values="-1 - 2147483647"
|
values="-1 - 2147483647"
|
||||||
special-values="default (-1), infinity (2147483647)" />
|
special-values="default (-1), infinity (2147483647)" />
|
||||||
<property name="dad-timeout"
|
<property name="dad-timeout"
|
||||||
nmcli-description="Maximum timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. The property is currently implemented only for IPv4. A zero value means that no duplicate address detection is performed, -1 means the default value (either the value configured globally in NetworkManger.conf or 200ms). A value greater than zero is a timeout in milliseconds. Note that the time intervals are subject to randomization as per RFC 5227 and so the actual duration can be between half and the full time specified in this property."
|
nmcli-description="Maximum timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. The property is currently implemented only for IPv4. A zero value means that no duplicate address detection is performed, -1 means the default value (either the value configured globally in NetworkManager.conf or 200ms). A value greater than zero is a timeout in milliseconds. Note that the time intervals are subject to randomization as per RFC 5227 and so the actual duration can be between half and the full time specified in this property."
|
||||||
format="integer"
|
format="integer"
|
||||||
values="-1 - 30000"
|
values="-1 - 30000"
|
||||||
special-values="default (-1), off (0)" />
|
special-values="default (-1), off (0)" />
|
||||||
|
|
@ -1578,7 +1578,7 @@
|
||||||
format="boolean"
|
format="boolean"
|
||||||
values="true/yes/on, false/no/off" />
|
values="true/yes/on, false/no/off" />
|
||||||
<property name="required-timeout"
|
<property name="required-timeout"
|
||||||
nmcli-description="The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds. This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active. Note that if "may-fail" is FALSE for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout. A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero)."
|
nmcli-description="The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds. This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IPv6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active. Note that if "may-fail" is FALSE for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout. A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero)."
|
||||||
format="integer"
|
format="integer"
|
||||||
values="-1 - 2147483647"
|
values="-1 - 2147483647"
|
||||||
special-values="default (-1), infinity (2147483647)" />
|
special-values="default (-1), infinity (2147483647)" />
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ executable(
|
||||||
'nm-editor-bindings.c',
|
'nm-editor-bindings.c',
|
||||||
'nm-editor-utils.c',
|
'nm-editor-utils.c',
|
||||||
'nmt-8021x-fields.c',
|
'nmt-8021x-fields.c',
|
||||||
'nmt-address-list.c',
|
|
||||||
'nmt-connect-connection-list.c',
|
'nmt-connect-connection-list.c',
|
||||||
'nmt-device-entry.c',
|
'nmt-device-entry.c',
|
||||||
'nmt-edit-connection-list.c',
|
'nmt-edit-connection-list.c',
|
||||||
|
|
@ -16,6 +15,7 @@ executable(
|
||||||
'nmt-editor-page-device.c',
|
'nmt-editor-page-device.c',
|
||||||
'nmt-editor-section.c',
|
'nmt-editor-section.c',
|
||||||
'nmt-ip-entry.c',
|
'nmt-ip-entry.c',
|
||||||
|
'nmt-list.c',
|
||||||
'nmt-mac-entry.c',
|
'nmt-mac-entry.c',
|
||||||
'nmt-mtu-entry.c',
|
'nmt-mtu-entry.c',
|
||||||
'nmt-page-bond.c',
|
'nmt-page-bond.c',
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ ip_addresses_with_prefix_from_strv(GBinding *binding,
|
||||||
* @source: the source object (eg, an #NMSettingIP4Config)
|
* @source: the source object (eg, an #NMSettingIP4Config)
|
||||||
* @source_property: the property on @source to bind (eg,
|
* @source_property: the property on @source to bind (eg,
|
||||||
* %NM_SETTING_IP4_CONFIG_ADDRESSES)
|
* %NM_SETTING_IP4_CONFIG_ADDRESSES)
|
||||||
* @target: the target object (eg, an #NmtAddressList)
|
* @target: the target object (eg, an #NmtList)
|
||||||
* @target_property: the property on @target to bind
|
* @target_property: the property on @target to bind
|
||||||
* (eg, "strings")
|
* (eg, "strings")
|
||||||
* @flags: %GBindingFlags
|
* @flags: %GBindingFlags
|
||||||
|
|
@ -253,7 +253,7 @@ ip_addresses_check_and_copy(GBinding *binding,
|
||||||
* @source: the source object (eg, an #NMSettingIP4Config)
|
* @source: the source object (eg, an #NMSettingIP4Config)
|
||||||
* @source_property: the property on @source to bind (eg,
|
* @source_property: the property on @source to bind (eg,
|
||||||
* %NM_SETTING_IP4_CONFIG_DNS)
|
* %NM_SETTING_IP4_CONFIG_DNS)
|
||||||
* @target: the target object (eg, an #NmtAddressList)
|
* @target: the target object (eg, an #NmtList)
|
||||||
* @target_property: the property on @target to bind
|
* @target_property: the property on @target to bind
|
||||||
* (eg, "strings")
|
* (eg, "strings")
|
||||||
* @flags: %GBindingFlags
|
* @flags: %GBindingFlags
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2013 Red Hat, Inc.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef NMT_ADDRESS_LIST_H
|
|
||||||
#define NMT_ADDRESS_LIST_H
|
|
||||||
|
|
||||||
#include "nmt-widget-list.h"
|
|
||||||
|
|
||||||
#define NMT_TYPE_ADDRESS_LIST (nmt_address_list_get_type())
|
|
||||||
#define NMT_ADDRESS_LIST(obj) \
|
|
||||||
(_NM_G_TYPE_CHECK_INSTANCE_CAST((obj), NMT_TYPE_ADDRESS_LIST, NmtAddressList))
|
|
||||||
#define NMT_ADDRESS_LIST_CLASS(klass) \
|
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass), NMT_TYPE_ADDRESS_LIST, NmtAddressListClass))
|
|
||||||
#define NMT_IS_ADDRESS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NMT_TYPE_ADDRESS_LIST))
|
|
||||||
#define NMT_IS_ADDRESS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NMT_TYPE_ADDRESS_LIST))
|
|
||||||
#define NMT_ADDRESS_LIST_GET_CLASS(obj) \
|
|
||||||
(G_TYPE_INSTANCE_GET_CLASS((obj), NMT_TYPE_ADDRESS_LIST, NmtAddressListClass))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NmtWidgetList parent;
|
|
||||||
|
|
||||||
} NmtAddressList;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
NmtWidgetListClass parent;
|
|
||||||
|
|
||||||
} NmtAddressListClass;
|
|
||||||
|
|
||||||
GType nmt_address_list_get_type(void);
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
NMT_ADDRESS_LIST_IP4_WITH_PREFIX,
|
|
||||||
NMT_ADDRESS_LIST_IP4,
|
|
||||||
NMT_ADDRESS_LIST_IP6_WITH_PREFIX,
|
|
||||||
NMT_ADDRESS_LIST_IP6,
|
|
||||||
NMT_ADDRESS_LIST_HOSTNAME
|
|
||||||
} NmtAddressListType;
|
|
||||||
|
|
||||||
NmtNewtWidget *nmt_address_list_new(NmtAddressListType list_type);
|
|
||||||
|
|
||||||
#endif /* NMT_ADDRESS_LIST_H */
|
|
||||||
|
|
@ -4,20 +4,19 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:nmt-address-list
|
* SECTION:nmt-list
|
||||||
* @short_description: An editable list of IP addresses or hostnames
|
* @short_description: An editable list of IP addresses, hostnames, or key=value pairs
|
||||||
*
|
*
|
||||||
* #NmtAddressList is a subclass of #NmtWidgetList that contains
|
* #NmtList is a subclass of #NmtWidgetList that contains
|
||||||
* entries displaying IP addresses, address/prefix strings, or
|
* entries displaying IP addresses, address/prefix strings,
|
||||||
* hostnames. This is designed for binding its #NmtAddressList:strings
|
* hostnames, or key=value pairs. This is designed for binding its
|
||||||
* property to an appropriate #NMSettingIP4Config or
|
* #NmtList:strings property to an appropriate property via one
|
||||||
* #NMSettingIP6Config property via one of the nm-editor-bindings
|
* of the nm-editor-bindings functions.
|
||||||
* functions.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libnm-client-aux-extern/nm-default-client.h"
|
#include "libnm-client-aux-extern/nm-default-client.h"
|
||||||
|
|
||||||
#include "nmt-address-list.h"
|
#include "nmt-list.h"
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
@ -25,15 +24,14 @@
|
||||||
|
|
||||||
#include "nmt-ip-entry.h"
|
#include "nmt-ip-entry.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE(NmtAddressList, nmt_address_list, NMT_TYPE_WIDGET_LIST)
|
G_DEFINE_TYPE(NmtList, nmt_list, NMT_TYPE_WIDGET_LIST)
|
||||||
|
|
||||||
#define NMT_ADDRESS_LIST_GET_PRIVATE(o) \
|
#define NMT_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), NMT_TYPE_LIST, NmtListPrivate))
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE((o), NMT_TYPE_ADDRESS_LIST, NmtAddressListPrivate))
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NmtAddressListType list_type;
|
NmtListType list_type;
|
||||||
char **strings;
|
char **strings;
|
||||||
} NmtAddressListPrivate;
|
} NmtListPrivate;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
|
@ -44,32 +42,32 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NmtAddressListType:
|
* NmtListType:
|
||||||
* @NMT_ADDRESS_LIST_IP4_WITH_PREFIX: IPv4 address/prefix strings
|
* @NMT_LIST_IP4_WITH_PREFIX: IPv4 address/prefix strings
|
||||||
* @NMT_ADDRESS_LIST_IP4: IPv4 addresses
|
* @NMT_LIST_IP4: IPv4 addresses
|
||||||
* @NMT_ADDRESS_LIST_IP6_WITH_PREFIX: IPv6 address/prefix strings
|
* @NMT_LIST_IP6_WITH_PREFIX: IPv6 address/prefix strings
|
||||||
* @NMT_ADDRESS_LIST_IP6: IPv6 addresses
|
* @NMT_LIST_IP6: IPv6 addresses
|
||||||
* @NMT_ADDRESS_LIST_HOSTNAME: hostnames
|
* @NMT_LIST_HOSTNAME: hostnames
|
||||||
*
|
*
|
||||||
* The type of address in an #NmtAddressList
|
* The type of address in an #NmtList
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nmt_address_list_new:
|
* nmt_list_new:
|
||||||
* @list_type: the type of address the list will contain
|
* @list_type: the type of address the list will contain
|
||||||
*
|
*
|
||||||
* Creates a new #NmtAddressList
|
* Creates a new #NmtList
|
||||||
*
|
*
|
||||||
* Returns: a new #NmtAddressList
|
* Returns: a new #NmtList
|
||||||
*/
|
*/
|
||||||
NmtNewtWidget *
|
NmtNewtWidget *
|
||||||
nmt_address_list_new(NmtAddressListType list_type)
|
nmt_list_new(NmtListType list_type)
|
||||||
{
|
{
|
||||||
return g_object_new(NMT_TYPE_ADDRESS_LIST, "list-type", list_type, NULL);
|
return g_object_new(NMT_TYPE_LIST, "list-type", list_type, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nmt_address_list_init(NmtAddressList *list)
|
nmt_list_init(NmtList *list)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
@ -95,9 +93,9 @@ strings_transform_from_entry(GBinding *binding,
|
||||||
GValue *target_value,
|
GValue *target_value,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
NmtAddressList *list = NMT_ADDRESS_LIST(g_binding_get_source(binding));
|
NmtList *list = NMT_LIST(g_binding_get_source(binding));
|
||||||
NmtAddressListPrivate *priv = NMT_ADDRESS_LIST_GET_PRIVATE(list);
|
NmtListPrivate *priv = NMT_LIST_GET_PRIVATE(list);
|
||||||
int n = GPOINTER_TO_INT(user_data);
|
int n = GPOINTER_TO_INT(user_data);
|
||||||
|
|
||||||
if (n >= g_strv_length(priv->strings))
|
if (n >= g_strv_length(priv->strings))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
@ -115,23 +113,38 @@ hostname_filter(NmtNewtEntry *entry, const char *text, int ch, int position, gpo
|
||||||
return g_ascii_isalnum(ch) || ch == '.' || ch == '-' || ch == '~';
|
return g_ascii_isalnum(ch) || ch == '.' || ch == '-' || ch == '~';
|
||||||
}
|
}
|
||||||
|
|
||||||
static NmtNewtWidget *
|
static gboolean
|
||||||
nmt_address_list_create_widget(NmtWidgetList *list, int num)
|
key_value_validate(NmtNewtEntry *entry, const char *text, gpointer user_data)
|
||||||
{
|
{
|
||||||
NmtAddressListPrivate *priv = NMT_ADDRESS_LIST_GET_PRIVATE(list);
|
const char *val;
|
||||||
NmtNewtWidget *entry;
|
|
||||||
|
|
||||||
if (priv->list_type == NMT_ADDRESS_LIST_IP4_WITH_PREFIX) {
|
if (!text || !text[0])
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
val = strchr(text, '=');
|
||||||
|
return val && val != text && val[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
static NmtNewtWidget *
|
||||||
|
nmt_list_create_widget(NmtWidgetList *list, int num)
|
||||||
|
{
|
||||||
|
NmtListPrivate *priv = NMT_LIST_GET_PRIVATE(list);
|
||||||
|
NmtNewtWidget *entry;
|
||||||
|
|
||||||
|
if (priv->list_type == NMT_LIST_IP4_WITH_PREFIX) {
|
||||||
entry = nmt_ip_entry_new(25, AF_INET, TRUE, FALSE);
|
entry = nmt_ip_entry_new(25, AF_INET, TRUE, FALSE);
|
||||||
} else if (priv->list_type == NMT_ADDRESS_LIST_IP4) {
|
} else if (priv->list_type == NMT_LIST_IP4) {
|
||||||
entry = nmt_ip_entry_new(25, AF_INET, FALSE, FALSE);
|
entry = nmt_ip_entry_new(25, AF_INET, FALSE, FALSE);
|
||||||
} else if (priv->list_type == NMT_ADDRESS_LIST_IP6_WITH_PREFIX) {
|
} else if (priv->list_type == NMT_LIST_IP6_WITH_PREFIX) {
|
||||||
entry = nmt_ip_entry_new(25, AF_INET6, TRUE, FALSE);
|
entry = nmt_ip_entry_new(25, AF_INET6, TRUE, FALSE);
|
||||||
} else if (priv->list_type == NMT_ADDRESS_LIST_IP6) {
|
} else if (priv->list_type == NMT_LIST_IP6) {
|
||||||
entry = nmt_ip_entry_new(25, AF_INET6, FALSE, FALSE);
|
entry = nmt_ip_entry_new(25, AF_INET6, FALSE, FALSE);
|
||||||
} else if (priv->list_type == NMT_ADDRESS_LIST_HOSTNAME) {
|
} else if (priv->list_type == NMT_LIST_HOSTNAME) {
|
||||||
entry = nmt_newt_entry_new(25, NMT_NEWT_ENTRY_NONEMPTY);
|
entry = nmt_newt_entry_new(25, NMT_NEWT_ENTRY_NONEMPTY);
|
||||||
nmt_newt_entry_set_filter(NMT_NEWT_ENTRY(entry), hostname_filter, list);
|
nmt_newt_entry_set_filter(NMT_NEWT_ENTRY(entry), hostname_filter, list);
|
||||||
|
} else if (priv->list_type == NMT_LIST_KEY_VALUE) {
|
||||||
|
entry = nmt_newt_entry_new(40, 0);
|
||||||
|
nmt_newt_entry_set_validator(NMT_NEWT_ENTRY(entry), key_value_validate, NULL);
|
||||||
} else {
|
} else {
|
||||||
g_return_val_if_reached(NULL);
|
g_return_val_if_reached(NULL);
|
||||||
}
|
}
|
||||||
|
|
@ -150,10 +163,10 @@ nmt_address_list_create_widget(NmtWidgetList *list, int num)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nmt_address_list_add_clicked(NmtWidgetList *list)
|
nmt_list_add_clicked(NmtWidgetList *list)
|
||||||
{
|
{
|
||||||
NmtAddressListPrivate *priv = NMT_ADDRESS_LIST_GET_PRIVATE(list);
|
NmtListPrivate *priv = NMT_LIST_GET_PRIVATE(list);
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = priv->strings ? g_strv_length(priv->strings) : 0;
|
len = priv->strings ? g_strv_length(priv->strings) : 0;
|
||||||
priv->strings = g_renew(char *, priv->strings, len + 2);
|
priv->strings = g_renew(char *, priv->strings, len + 2);
|
||||||
|
|
@ -165,10 +178,10 @@ nmt_address_list_add_clicked(NmtWidgetList *list)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nmt_address_list_remove_clicked(NmtWidgetList *list, int num)
|
nmt_list_remove_clicked(NmtWidgetList *list, int num)
|
||||||
{
|
{
|
||||||
NmtAddressListPrivate *priv = NMT_ADDRESS_LIST_GET_PRIVATE(list);
|
NmtListPrivate *priv = NMT_LIST_GET_PRIVATE(list);
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = g_strv_length(priv->strings);
|
len = g_strv_length(priv->strings);
|
||||||
g_free(priv->strings[num]);
|
g_free(priv->strings[num]);
|
||||||
|
|
@ -179,12 +192,9 @@ nmt_address_list_remove_clicked(NmtWidgetList *list, int num)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nmt_address_list_set_property(GObject *object,
|
nmt_list_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
{
|
||||||
NmtAddressListPrivate *priv = NMT_ADDRESS_LIST_GET_PRIVATE(object);
|
NmtListPrivate *priv = NMT_LIST_GET_PRIVATE(object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_LIST_TYPE:
|
case PROP_LIST_TYPE:
|
||||||
|
|
@ -204,9 +214,9 @@ nmt_address_list_set_property(GObject *object,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nmt_address_list_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
nmt_list_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NmtAddressListPrivate *priv = NMT_ADDRESS_LIST_GET_PRIVATE(object);
|
NmtListPrivate *priv = NMT_LIST_GET_PRIVATE(object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_LIST_TYPE:
|
case PROP_LIST_TYPE:
|
||||||
|
|
@ -222,23 +232,23 @@ nmt_address_list_get_property(GObject *object, guint prop_id, GValue *value, GPa
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nmt_address_list_class_init(NmtAddressListClass *list_class)
|
nmt_list_class_init(NmtListClass *list_class)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS(list_class);
|
GObjectClass *object_class = G_OBJECT_CLASS(list_class);
|
||||||
NmtWidgetListClass *widget_list_class = NMT_WIDGET_LIST_CLASS(list_class);
|
NmtWidgetListClass *widget_list_class = NMT_WIDGET_LIST_CLASS(list_class);
|
||||||
|
|
||||||
g_type_class_add_private(list_class, sizeof(NmtAddressListPrivate));
|
g_type_class_add_private(list_class, sizeof(NmtListPrivate));
|
||||||
|
|
||||||
/* virtual methods */
|
/* virtual methods */
|
||||||
object_class->set_property = nmt_address_list_set_property;
|
object_class->set_property = nmt_list_set_property;
|
||||||
object_class->get_property = nmt_address_list_get_property;
|
object_class->get_property = nmt_list_get_property;
|
||||||
|
|
||||||
widget_list_class->create_widget = nmt_address_list_create_widget;
|
widget_list_class->create_widget = nmt_list_create_widget;
|
||||||
widget_list_class->add_clicked = nmt_address_list_add_clicked;
|
widget_list_class->add_clicked = nmt_list_add_clicked;
|
||||||
widget_list_class->remove_clicked = nmt_address_list_remove_clicked;
|
widget_list_class->remove_clicked = nmt_list_remove_clicked;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NmtAddressList:list-type:
|
* NmtList:list-type:
|
||||||
*
|
*
|
||||||
* The type of address the list holds.
|
* The type of address the list holds.
|
||||||
*/
|
*/
|
||||||
|
|
@ -253,7 +263,7 @@ nmt_address_list_class_init(NmtAddressListClass *list_class)
|
||||||
0,
|
0,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
|
||||||
/**
|
/**
|
||||||
* NmtAddressList:strings:
|
* NmtList:strings:
|
||||||
*
|
*
|
||||||
* The strings in the list's entries.
|
* The strings in the list's entries.
|
||||||
*/
|
*/
|
||||||
41
src/nmtui/nmt-list.h
Normal file
41
src/nmtui/nmt-list.h
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Red Hat, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NMT_LIST_H
|
||||||
|
#define NMT_LIST_H
|
||||||
|
|
||||||
|
#include "nmt-widget-list.h"
|
||||||
|
|
||||||
|
#define NMT_TYPE_LIST (nmt_list_get_type())
|
||||||
|
#define NMT_LIST(obj) (_NM_G_TYPE_CHECK_INSTANCE_CAST((obj), NMT_TYPE_LIST, NmtList))
|
||||||
|
#define NMT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), NMT_TYPE_LIST, NmtListClass))
|
||||||
|
#define NMT_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NMT_TYPE_LIST))
|
||||||
|
#define NMT_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NMT_TYPE_LIST))
|
||||||
|
#define NMT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), NMT_TYPE_LIST, NmtListClass))
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NmtWidgetList parent;
|
||||||
|
|
||||||
|
} NmtList;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
NmtWidgetListClass parent;
|
||||||
|
|
||||||
|
} NmtListClass;
|
||||||
|
|
||||||
|
GType nmt_list_get_type(void);
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
NMT_LIST_IP4_WITH_PREFIX,
|
||||||
|
NMT_LIST_IP4,
|
||||||
|
NMT_LIST_IP6_WITH_PREFIX,
|
||||||
|
NMT_LIST_IP6,
|
||||||
|
NMT_LIST_HOSTNAME,
|
||||||
|
NMT_LIST_KEY_VALUE
|
||||||
|
} NmtListType;
|
||||||
|
|
||||||
|
NmtNewtWidget *nmt_list_new(NmtListType list_type);
|
||||||
|
|
||||||
|
#endif /* NMT_LIST_H */
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
|
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
|
||||||
#include "nmt-mac-entry.h"
|
#include "nmt-mac-entry.h"
|
||||||
#include "nmt-address-list.h"
|
#include "nmt-list.h"
|
||||||
#include "nmt-port-list.h"
|
#include "nmt-port-list.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE(NmtPageBond, nmt_page_bond, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
G_DEFINE_TYPE(NmtPageBond, nmt_page_bond, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||||
|
|
@ -41,14 +41,15 @@ typedef struct {
|
||||||
/* Note: when adding new options to the UI also ensure they are
|
/* Note: when adding new options to the UI also ensure they are
|
||||||
* initialized in bond_connection_setup_func()
|
* initialized in bond_connection_setup_func()
|
||||||
*/
|
*/
|
||||||
NmtNewtPopup *mode;
|
NmtNewtPopup *mode;
|
||||||
NmtNewtEntry *primary;
|
NmtNewtEntry *primary;
|
||||||
NmtNewtPopup *monitoring;
|
NmtNewtPopup *monitoring;
|
||||||
NmtNewtEntry *miimon;
|
NmtNewtEntry *miimon;
|
||||||
NmtNewtEntry *updelay;
|
NmtNewtEntry *updelay;
|
||||||
NmtNewtEntry *downdelay;
|
NmtNewtEntry *downdelay;
|
||||||
NmtNewtEntry *arp_interval;
|
NmtNewtEntry *arp_interval;
|
||||||
NmtAddressList *arp_ip_target;
|
NmtList *arp_ip_target;
|
||||||
|
NmtList *other_options;
|
||||||
|
|
||||||
NmtPageBondMonitoringMode monitoring_mode;
|
NmtPageBondMonitoringMode monitoring_mode;
|
||||||
|
|
||||||
|
|
@ -63,6 +64,43 @@ static void arp_ip_target_widget_changed(GObject *object, GParamSpec *pspec, gpo
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_is_other_option(const char *option)
|
||||||
|
{
|
||||||
|
return !NM_IN_STRSET(option,
|
||||||
|
NM_SETTING_BOND_OPTION_MODE,
|
||||||
|
NM_SETTING_BOND_OPTION_PRIMARY,
|
||||||
|
NM_SETTING_BOND_OPTION_MIIMON,
|
||||||
|
NM_SETTING_BOND_OPTION_UPDELAY,
|
||||||
|
NM_SETTING_BOND_OPTION_DOWNDELAY,
|
||||||
|
NM_SETTING_BOND_OPTION_ARP_INTERVAL,
|
||||||
|
NM_SETTING_BOND_OPTION_ARP_IP_TARGET);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_bond_update_other_options(NMSettingBond *s_bond, NmtList *list)
|
||||||
|
{
|
||||||
|
gs_unref_ptrarray GPtrArray *arr = g_ptr_array_new_with_free_func(g_free);
|
||||||
|
guint num_opts = nm_setting_bond_get_num_options(s_bond);
|
||||||
|
guint i;
|
||||||
|
|
||||||
|
for (i = 0; i < num_opts; i++) {
|
||||||
|
const char *opt_name;
|
||||||
|
const char *opt_value;
|
||||||
|
|
||||||
|
nm_assert(nm_setting_bond_get_option(s_bond, i, &opt_name, &opt_value));
|
||||||
|
|
||||||
|
if (_is_other_option(opt_name)) {
|
||||||
|
g_ptr_array_add(arr, g_strdup_printf("%s=%s", opt_name, opt_value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_ptr_array_add(arr, NULL);
|
||||||
|
g_object_set(G_OBJECT(list), "strings", arr->pdata, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
NmtEditorPage *
|
NmtEditorPage *
|
||||||
nmt_page_bond_new(NMConnection *conn, NmtDeviceEntry *deventry)
|
nmt_page_bond_new(NMConnection *conn, NmtDeviceEntry *deventry)
|
||||||
{
|
{
|
||||||
|
|
@ -155,6 +193,8 @@ bond_options_changed(GObject *object, GParamSpec *pspec, gpointer user_data)
|
||||||
nmt_newt_widget_set_visible(NMT_NEWT_WIDGET(priv->arp_interval), !visible_mii);
|
nmt_newt_widget_set_visible(NMT_NEWT_WIDGET(priv->arp_interval), !visible_mii);
|
||||||
nmt_newt_widget_set_visible(NMT_NEWT_WIDGET(priv->arp_ip_target), !visible_mii);
|
nmt_newt_widget_set_visible(NMT_NEWT_WIDGET(priv->arp_ip_target), !visible_mii);
|
||||||
|
|
||||||
|
_bond_update_other_options(s_bond, priv->other_options);
|
||||||
|
|
||||||
priv->updating = FALSE;
|
priv->updating = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -308,6 +348,47 @@ arp_ip_target_widget_changed(GObject *object, GParamSpec *pspec, gpointer user_d
|
||||||
g_strfreev(ips);
|
g_strfreev(ips);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
other_options_widget_changed(GObject *object, GParamSpec *pspec, gpointer user_data)
|
||||||
|
{
|
||||||
|
NmtPageBond *bond = NMT_PAGE_BOND(user_data);
|
||||||
|
NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE(bond);
|
||||||
|
gs_strfreev char **other_options = NULL;
|
||||||
|
const char *name;
|
||||||
|
guint num;
|
||||||
|
guint i;
|
||||||
|
|
||||||
|
if (priv->updating)
|
||||||
|
return;
|
||||||
|
|
||||||
|
priv->updating = TRUE;
|
||||||
|
|
||||||
|
g_object_get(G_OBJECT(priv->other_options), "strings", &other_options, NULL);
|
||||||
|
|
||||||
|
again:
|
||||||
|
num = nm_setting_bond_get_num_options(priv->s_bond);
|
||||||
|
for (i = 0; i < num; i++) {
|
||||||
|
nm_assert(nm_setting_bond_get_option(priv->s_bond, i, &name, NULL));
|
||||||
|
|
||||||
|
if (_is_other_option(name)) {
|
||||||
|
nm_setting_bond_remove_option(priv->s_bond, name);
|
||||||
|
goto again;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; other_options && other_options[i]; i++) {
|
||||||
|
char *val = strchr(other_options[i], '=');
|
||||||
|
|
||||||
|
if (val && val != other_options[i] && val[1]) {
|
||||||
|
*val = '\0';
|
||||||
|
if (_is_other_option(other_options[i]))
|
||||||
|
nm_setting_bond_add_option(priv->s_bond, other_options[i], val + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
priv->updating = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
bond_connection_type_filter(GType connection_type, gpointer user_data)
|
bond_connection_type_filter(GType connection_type, gpointer user_data)
|
||||||
{
|
{
|
||||||
|
|
@ -390,10 +471,15 @@ nmt_page_bond_constructed(GObject *object)
|
||||||
nmt_editor_grid_append(grid, _("Monitoring frequency"), widget, label);
|
nmt_editor_grid_append(grid, _("Monitoring frequency"), widget, label);
|
||||||
priv->arp_interval = NMT_NEWT_ENTRY(widget);
|
priv->arp_interval = NMT_NEWT_ENTRY(widget);
|
||||||
|
|
||||||
widget = nmt_address_list_new(NMT_ADDRESS_LIST_IP4);
|
widget = nmt_list_new(NMT_LIST_IP4);
|
||||||
g_signal_connect(widget, "notify::strings", G_CALLBACK(arp_ip_target_widget_changed), bond);
|
g_signal_connect(widget, "notify::strings", G_CALLBACK(arp_ip_target_widget_changed), bond);
|
||||||
nmt_editor_grid_append(grid, _("ARP targets"), widget, NULL);
|
nmt_editor_grid_append(grid, _("ARP targets"), widget, NULL);
|
||||||
priv->arp_ip_target = NMT_ADDRESS_LIST(widget);
|
priv->arp_ip_target = NMT_LIST(widget);
|
||||||
|
|
||||||
|
widget = nmt_list_new(NMT_LIST_KEY_VALUE);
|
||||||
|
g_signal_connect(widget, "notify::strings", G_CALLBACK(other_options_widget_changed), bond);
|
||||||
|
nmt_editor_grid_append(grid, _("Other options (key=value)"), widget, NULL);
|
||||||
|
priv->other_options = NMT_LIST(widget);
|
||||||
|
|
||||||
widget = nmt_mac_entry_new(40, ETH_ALEN, NMT_MAC_ENTRY_TYPE_CLONED_ETHERNET);
|
widget = nmt_mac_entry_new(40, ETH_ALEN, NMT_MAC_ENTRY_TYPE_CLONED_ETHERNET);
|
||||||
g_object_bind_property(s_wired,
|
g_object_bind_property(s_wired,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
#include "nmt-page-bridge.h"
|
#include "nmt-page-bridge.h"
|
||||||
|
|
||||||
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
|
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
|
||||||
#include "nmt-address-list.h"
|
#include "nmt-list.h"
|
||||||
#include "nmt-port-list.h"
|
#include "nmt-port-list.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE(NmtPageBridge, nmt_page_bridge, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
G_DEFINE_TYPE(NmtPageBridge, nmt_page_bridge, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
|
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
|
||||||
#include "nmt-ip-entry.h"
|
#include "nmt-ip-entry.h"
|
||||||
#include "nmt-address-list.h"
|
#include "nmt-list.h"
|
||||||
#include "nmt-route-editor.h"
|
#include "nmt-route-editor.h"
|
||||||
|
|
||||||
#include "nm-editor-bindings.h"
|
#include "nm-editor-bindings.h"
|
||||||
|
|
@ -112,7 +112,7 @@ nmt_page_ip4_constructed(GObject *object)
|
||||||
section = nmt_editor_section_new(_("IPv4 CONFIGURATION"), widget, show_by_default);
|
section = nmt_editor_section_new(_("IPv4 CONFIGURATION"), widget, show_by_default);
|
||||||
grid = nmt_editor_section_get_body(section);
|
grid = nmt_editor_section_get_body(section);
|
||||||
|
|
||||||
widget = nmt_address_list_new(NMT_ADDRESS_LIST_IP4_WITH_PREFIX);
|
widget = nmt_list_new(NMT_LIST_IP4_WITH_PREFIX);
|
||||||
nm_editor_bind_ip_addresses_with_prefix_to_strv(AF_INET,
|
nm_editor_bind_ip_addresses_with_prefix_to_strv(AF_INET,
|
||||||
s_ip4,
|
s_ip4,
|
||||||
NM_SETTING_IP_CONFIG_ADDRESSES,
|
NM_SETTING_IP_CONFIG_ADDRESSES,
|
||||||
|
|
@ -131,7 +131,7 @@ nmt_page_ip4_constructed(GObject *object)
|
||||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||||
nmt_editor_grid_append(grid, _("Gateway"), widget, NULL);
|
nmt_editor_grid_append(grid, _("Gateway"), widget, NULL);
|
||||||
|
|
||||||
widget = nmt_address_list_new(NMT_ADDRESS_LIST_IP4);
|
widget = nmt_list_new(NMT_LIST_IP4);
|
||||||
nm_editor_bind_ip_addresses_to_strv(AF_INET,
|
nm_editor_bind_ip_addresses_to_strv(AF_INET,
|
||||||
s_ip4,
|
s_ip4,
|
||||||
NM_SETTING_IP_CONFIG_DNS,
|
NM_SETTING_IP_CONFIG_DNS,
|
||||||
|
|
@ -140,7 +140,7 @@ nmt_page_ip4_constructed(GObject *object)
|
||||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||||
nmt_editor_grid_append(grid, _("DNS servers"), widget, NULL);
|
nmt_editor_grid_append(grid, _("DNS servers"), widget, NULL);
|
||||||
|
|
||||||
widget = nmt_address_list_new(NMT_ADDRESS_LIST_HOSTNAME);
|
widget = nmt_list_new(NMT_LIST_HOSTNAME);
|
||||||
g_object_bind_property(s_ip4,
|
g_object_bind_property(s_ip4,
|
||||||
NM_SETTING_IP_CONFIG_DNS_SEARCH,
|
NM_SETTING_IP_CONFIG_DNS_SEARCH,
|
||||||
widget,
|
widget,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
|
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
|
||||||
#include "nmt-ip-entry.h"
|
#include "nmt-ip-entry.h"
|
||||||
#include "nmt-address-list.h"
|
#include "nmt-list.h"
|
||||||
#include "nmt-route-editor.h"
|
#include "nmt-route-editor.h"
|
||||||
|
|
||||||
#include "nm-editor-bindings.h"
|
#include "nm-editor-bindings.h"
|
||||||
|
|
@ -114,7 +114,7 @@ nmt_page_ip6_constructed(GObject *object)
|
||||||
section = nmt_editor_section_new(_("IPv6 CONFIGURATION"), widget, show_by_default);
|
section = nmt_editor_section_new(_("IPv6 CONFIGURATION"), widget, show_by_default);
|
||||||
grid = nmt_editor_section_get_body(section);
|
grid = nmt_editor_section_get_body(section);
|
||||||
|
|
||||||
widget = nmt_address_list_new(NMT_ADDRESS_LIST_IP6_WITH_PREFIX);
|
widget = nmt_list_new(NMT_LIST_IP6_WITH_PREFIX);
|
||||||
nm_editor_bind_ip_addresses_with_prefix_to_strv(AF_INET6,
|
nm_editor_bind_ip_addresses_with_prefix_to_strv(AF_INET6,
|
||||||
s_ip6,
|
s_ip6,
|
||||||
NM_SETTING_IP_CONFIG_ADDRESSES,
|
NM_SETTING_IP_CONFIG_ADDRESSES,
|
||||||
|
|
@ -133,7 +133,7 @@ nmt_page_ip6_constructed(GObject *object)
|
||||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||||
nmt_editor_grid_append(grid, _("Gateway"), widget, NULL);
|
nmt_editor_grid_append(grid, _("Gateway"), widget, NULL);
|
||||||
|
|
||||||
widget = nmt_address_list_new(NMT_ADDRESS_LIST_IP6);
|
widget = nmt_list_new(NMT_LIST_IP6);
|
||||||
nm_editor_bind_ip_addresses_to_strv(AF_INET6,
|
nm_editor_bind_ip_addresses_to_strv(AF_INET6,
|
||||||
s_ip6,
|
s_ip6,
|
||||||
NM_SETTING_IP_CONFIG_DNS,
|
NM_SETTING_IP_CONFIG_DNS,
|
||||||
|
|
@ -142,7 +142,7 @@ nmt_page_ip6_constructed(GObject *object)
|
||||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||||
nmt_editor_grid_append(grid, _("DNS servers"), widget, NULL);
|
nmt_editor_grid_append(grid, _("DNS servers"), widget, NULL);
|
||||||
|
|
||||||
widget = nmt_address_list_new(NMT_ADDRESS_LIST_HOSTNAME);
|
widget = nmt_list_new(NMT_LIST_HOSTNAME);
|
||||||
g_object_bind_property(s_ip6,
|
g_object_bind_property(s_ip6,
|
||||||
NM_SETTING_IP_CONFIG_DNS_SEARCH,
|
NM_SETTING_IP_CONFIG_DNS_SEARCH,
|
||||||
widget,
|
widget,
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
* buttons next to each one, and an "Add" button at the button to add
|
* buttons next to each one, and an "Add" button at the button to add
|
||||||
* new ones.
|
* new ones.
|
||||||
*
|
*
|
||||||
* It is the base class for #NmtAddressList, and is used internally by
|
* It is the base class for #NmtList, and is used internally by
|
||||||
* #NmtRouteTable.
|
* #NmtRouteTable.
|
||||||
*
|
*
|
||||||
* FIXME: The way this works is sort of weird.
|
* FIXME: The way this works is sort of weird.
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,7 @@ nmt_wireguard_peer_list_add_peer(NmtWireguardPeerList *list)
|
||||||
NmtNewtForm *editor;
|
NmtNewtForm *editor;
|
||||||
|
|
||||||
editor = nmt_wireguard_peer_editor_new(priv->setting, peer);
|
editor = nmt_wireguard_peer_editor_new(priv->setting, peer);
|
||||||
|
nm_wireguard_peer_unref(peer);
|
||||||
|
|
||||||
if (!editor)
|
if (!editor)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue