Compare commits

...

46 commits

Author SHA1 Message Date
Íñigo Huguet
81209b4688 merge: branch 'ih/fix_uint_uflow'
daemon: fix substraction underflow

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2409
2026-05-08 05:40:40 +00:00
Íñigo Huguet
f1024d047f daemon: fix substraction underflow
Fixes: 1747eb96d6 ('manager: Ensure DHCP interface delete first when daemon stop')
2026-05-07 15:03:36 +02:00
Rahul Rajesh
19b065bc4a merge: branch 'rr/controller-dhcp-send-release'
device: send dhcp send release before device removed

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2400
2026-04-30 15:31:39 +00:00
Gris Ge
1747eb96d6 manager: Ensure DHCP interface delete first when daemon stop
Given linux bridge/bond holds DHCP config with
`ipv4.dhcp-send-release: ture` or `ipv6.dhcp-send-release: true`,
when stopping NetworkManager daemon, then NM daemon might
remove/deactivate physical interface first causing DHCP release packet
cannot be delivered.

To fix the issue, we sort the device deletion to let software device
that holds DHCP config to remove first.

Merge Request: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2379

Co-authored-by: Rahul Rajesh <rajeshrah22@gmail.com>
2026-04-29 17:04:04 -04:00
Rahul Rajesh
09784fcce3 device: cleanup DHCP before devices removed
Add _dev_ipdhcpx_cleanup in __set_state_full in DEACTIVATING STATE
before STATE_CHANGED signal is emitted to ensure DHCP RELEASE
packet is sent.

Assisted-by: Cursor with Claude Opus 4.5
2026-04-29 17:03:57 -04:00
Jan Vaclav
9303996b44 merge: branch 'jv/coverity'
coverity: fix bugs found by static analysis

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2394
2026-04-15 08:33:32 +00:00
Jan Vaclav
ca326bd636 libnm/tests: fix dead code in WireGuard roundtrip test
The inner condition at line 4086 duplicated the outer check for
NM_CONNECTION_SERIALIZE_ALL, making the else-if branch for
NM_CONNECTION_SERIALIZE_WITH_NON_SECRET unreachable. This meant
the non-secret serialization path was never actually tested.

Restructure to make both branches reachable.

Found by Coverity (CID: DEADCODE).

Fixes: 395a78618b ('libnm/tests: add tests for creating wireguard connection profiles')

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
3d4ad7b4ba libnm: fix wrong variable in route attribute validation error message
The validation checks 'addr' (the extracted address portion before '/')
but the error message prints 'string' (the full input including the
prefix). For input like "192.168.1.999/24", the error would show the
full string instead of just the invalid address part.

Found by Coverity (CID: COPY_PASTE_ERROR).

Fixes: 539db43619 ('libnm: avoid heap allocation for checking valid routes in nm_ip_route_attribute_validate()')

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
33871478b7 initrd: fix use-after-free when multiple iBFT entries fail
The error variable is declared outside the loop but freed with
g_error_free() which does not reset the pointer to NULL. On the
next iteration, g_set_error() sees a non-NULL *err (dangling pointer)
and error->message dereferences freed memory.

Use g_clear_error() instead which also resets the pointer.

Found by Coverity (CID: USE_AFTER_FREE).

Fixes: ecc074b2f8 ('initrd: add command line parser')

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
00f9a3d862 nmtui/wireguard: fix peer leak when adding new peer
nm_wireguard_peer_new() returns a new peer with refcount 1.
nmt_wireguard_peer_editor_new() takes its own copy via
g_value_dup_boxed(), so the original peer was never unreffed.

Unref the peer after passing it to the editor.

Found by Coverity (CID: RESOURCE_LEAK).

Fixes: b0f5b1d97a ('tui: add WireGuard support to nmtui')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
8685ac1845 dns: fix infinite loop in assertion checking search domains
The loop condition checked the same pointer twice instead of checking
the array element: `ip_data->domains.search && ip_data->domains.search`
should be `ip_data->domains.search && ip_data->domains.search[i]`.

As written, the loop would never terminate when `search` is non-NULL
(only in debug builds with NM_MORE_ASSERTS > 5).

Found by Coverity (CID: CONSTANT_EXPRESSION_RESULT).

Fixes: b8dab47705 ('dns: fix handling default routing domains with systemd-resolved')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
56099c5e14 device: fix potential null dereference when releasing port
find_port_info() can return NULL if the port is not registered.
The code dereferenced `info->port_state` before the null check,
which would crash. Move the null check before the dereference.

Found by Coverity (CID: REVERSE_INULL).

Fixes: a8329587c8 ('device: fix bug when deactivating port connections asynchronously')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:54:12 +02:00
Jan Vaclav
4565c9efe4 policy: fix integer overflow in IPv6 PD subnet calculation
The literal `1` is a 32-bit int. When prefix length is less than 33,
the shift `(64 - plen)` exceeds 31 bits, causing undefined behavior.
Cast to guint64 (same type as `num_subnets`) to perform the shift in
64-bit arithmetic.

Found by Coverity (CID: OVERFLOW_BEFORE_WIDEN).

Fixes: ec12fcf6bf ('policy: delegate IPv6 configuration to ipv6.method=shared connections')
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 12:53:43 +02:00
Íñigo Huguet
6b038ef4dc merge: branch 'issue1476'
bond: change default value of `arp_missed_max`

Closes #1476

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2288
2026-04-14 05:46:02 +00:00
Pradyumn Rahar
921fe6ec68 The valid range of arp_missed_max according to the kernel is 1-255,
while the default value of the same in NM is 0, which causes warnings to
arise, change this default value.

Allow the range in NM to stay 0-255 as 0 is used to indicate arp_missed_max
is unset (for modes that don't support the setting), however do not let it
be set beyond the kernel permissible range for the modes that support it, set
it to the kernel default of 2 instead.

Do not apply or reapply the arp_missed_max setting when it is not
supported.

Signed-off-by: Pradyumn Rahar <pradyumn.rahar@oracle.com>
2026-04-14 10:20:27 +05:30
Íñigo Huguet
95a329a927 merge: branch 'misc-fixes'
Miscellaneous fixes: veth, macvlan, spec

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2248
2026-04-09 13:39:21 +00:00
David Ward
09e2de8b68 spec: fix scriptlet dependencies
Adjust %postun to handle missing udev, in the same way %post does.
This permits installation inside a container without udev.

/usr/sbin/update-alternatives is needed for the initscripts-updown
subpackage only.
2026-04-09 13:33:32 +00:00
David Ward
372fb5792c veth: fix updating peer when link changed
When creating the first device in a veth pair, the peer ifindex is
valid, but the peer device does not exist yet. This should be set
when update_properties() is called for the second device, but fix
the conditional.
2026-04-09 13:33:32 +00:00
David Ward
631127d2e5 macvlan: fix D-Bus property name 2026-04-09 13:33:32 +00:00
Jan Vaclav
fe793cd783 merge: branch 'jv/tui-bond-other'
nmtui/bond: introduce "other options" list

Closes #1805

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2392
2026-04-09 09:54:25 +00:00
Jan Vaclav
0b3db7c6ee nmtui: rename NMTAddressList -> NmtList 2026-04-09 11:33:20 +02:00
Jan Vaclav
6a841072ec nmtui/bond: introduce "other options" list
Bond connections can have options that are not exposed by any widget
in the bond editor. The presence of certain mode-specific options makes
it impossible to change the mode, e.g. from 802.3ad to active-backup
when `lacp_rate` is set.

Introduce an "Other options" list that shows all bond options not
already configurable by a specific widget, and allow the user to edit
them as key=value entries.

Resolves #1805
Resolves: https://redhat.atlassian.net/browse/NMT-1888
2026-04-09 11:33:20 +02:00
Íñigo Huguet
e8f379abb8 merge: branch 'fix/pppd-gateway-empty-ipcp'
pppd-plugin: fix gateway for PPP connections without carrier-provided remote IP

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2383
2026-04-09 08:00:31 +00:00
Ben Hagen
bd0a6356eb pppd-plugin: fix gateway for PPP connections without carrier-provided remote IP
During the dbus-glib to GDBus port in 89228569f (2014), the last-resort
gateway in nm_ip_up() was accidentally changed from peer_opts.hisaddr to
peer_opts.ouraddr. peer_opts.ouraddr is typically 0 when IPCP does not
provide a peer address, causing gateway=0 and broken PPP connectivity
probing/routing behavior.

Restore the original behavior from 369299271 (2008).

Fixes: 89228569f8 ('ppp-manager: port nm-pppd-plugin from dbus-glib to gdbus')
2026-04-09 08:00:12 +00:00
Íñigo Huguet
5e02f13611 merge: branch 'main'
po: Update Serbian (sr) and Serbian Latin (sr@latin) translations

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2385
2026-04-08 13:06:28 +00:00
Марко М. Костић (Marko M. Kostić)
834ae00607 po: Update Serbian Latin translation 2026-04-08 13:05:36 +00:00
Марко М. Костић (Marko M. Kostić)
d9c143ee58 po: Update Serbian translation 2026-04-08 13:05:36 +00:00
Íñigo Huguet
230009b9e8 merge: branch 'ih/sl-po'
po: update Slovenian translations

Closes #1894

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2374
2026-04-08 10:53:34 +00:00
filmsi
253ce99d2c po: update Slovenian translations 2026-04-08 10:53:25 +00:00
Íñigo Huguet
c86ae51240 merge: branch 'fixtypo'
Fix typos

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2371
2026-04-08 10:19:36 +00:00
Hiroyuki Yasuhara
9ca09aa020 cloud-setup/man: fix typo in man nm-cloud-setup 2026-04-08 10:19:23 +00:00
Hiroyuki Yasuhara
a6e133d5f4 libnm/docs: fix typo in man nm-settings-nmcli 2026-04-08 10:19:23 +00:00
Hiroyuki Yasuhara
330cb6a20b docs/libnm: fix typo in libnm.svg 2026-04-08 10:19:23 +00:00
Íñigo Huguet
92bf0178a4 merge: branch 'typo-fixes-2026'
libnmc-setting: fix typos

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2377
2026-04-08 10:17:06 +00:00
Anders Jonsson
e50272de78 libnmc-setting: fix typos 2026-04-08 10:13:31 +00:00
Íñigo Huguet
72950e5d5b merge: branch 'fix/meson'
meson: fix cross-compilation issues

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2380
2026-04-08 10:11:27 +00:00
Andrej Kozemcak
e5d2c7cc6d meson: fix cross-compilation issues
Strip newline from GI_TYPELIB_PATH and LD_LIBRARY_PATH
run_command().stdout() returns the raw shell output including a trailing
newline. When the value is used to build a colon-separated path, the newline
gets embedded at the end of the last path component, making the directory
invalid and causing GObject Introspection to fail with:

  ImportError: Typelib file for namespace 'Gio', version '2.0' not found

Use .strip() to remove leading/trailing whitespace from both env variable
reads.

Fix jansson SONAME detection for cross-compilation
When cross-compiling, jansson's pkg-config 'libdir' variable returns a
path relative to the sysroot (e.g., /usr/lib) without the actual sysroot
prefix.  The host readelf binary cannot find the library at that path.

Fix this by using meson.get_external_property('sys_root', '') to obtain
the sysroot path set by the cross-compilation environment and prepend it
to the library path before calling readelf.

Signed-off-by: Andrej Kozemcak <andrej.kozemcak@siemens.com>
2026-04-08 10:11:13 +00:00
Íñigo Huguet
bb50e8f0f4 merge: branch 'rr/fix-avc-error-2'
core: use GDir to avoid libgvfs loading

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2384
2026-04-08 08:30:37 +00:00
Rahul Rajesh
2e1ee043a7 core: use GDir to avoid libgvfs loading
Replace GFile with GDir to avoid libgvfs and other DBus infra
initialization.

This was done mainly to avoid heavy initialization just for executing
NetworkManager --print-config command.

Resolves: https://redhat.atlassian.net/browse/RHEL-140113
2026-04-08 08:30:18 +00:00
Íñigo Huguet
58f4c81673 merge: branch 'ih/dhcp-client-unknown'
dhcp: improve log message for unknown DHCP plugin

Closes #1917

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2388
2026-04-08 07:50:51 +00:00
Íñigo Huguet
24c50803a7 dhcp: improve log message for unknown DHCP plugin
If a DHCP plugin is unknown, the logs says "DHCP client 'x' not
available". This is the same message that is shown if, for example, it
is a valid DHCP plugin name, but the program is not installed in the
system.

For example, after 'dhclient' was deprecated, now NM is built without
support for it. Then, people with old configs `dhcp=dhclient` get the
message "DHCP client 'dhclient' not available". That seems to mean that
dhclient is not installed.

Show a message "unknown DHCP client" instead.

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/work_items/1917
2026-04-08 07:50:41 +00:00
Íñigo Huguet
7f4efc484c merge: branch 'ih/spec'
rpm spec: set polkit_noauth_group=wheel by default

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2391
2026-04-08 07:50:11 +00:00
Íñigo Huguet
1970d8a8cd spec: set polkit_noauth_group=wheel by default
In Fedora there were complains about needing sudo to do changes. We
decided to allow doing changes without additional authentication if
they're done from a local console and an admin account.
2026-04-08 07:49:52 +00:00
Gris Ge
de91bd8070 merge: branch 'jv/clat-macro'
l3cfg: wrap _clat_prefix_is_better() in HAVE_CLAT guard

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2390
2026-04-01 10:06:51 +00:00
Jan Vaclav
66ac355c52 l3cfg: wrap _clat_prefix_is_better() in HAVE_CLAT guard
Fixes the following warning when building without CLAT:
../src/core/nm-l3cfg.c:4157:1: warning: ‘_clat_prefix_is_better’ defined but not used [-Wunused-function]
 4157 | _clat_prefix_is_better(const NMPlatformIP6Address *best,
      | ^~~~~~~~~~~~~~~~~~~~~~

Fixes: a03a245819 ('l3cfg: fix selection of the CLAT IPv6 prefix')
2026-03-31 11:44:42 +02:00
Rahul Rajesh
fb1104d278 release: bump version to 1.57.4 (development) 2026-03-27 09:08:35 -04:00
42 changed files with 15497 additions and 18912 deletions

3
NEWS
View file

@ -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

View file

@ -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}

View file

@ -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

View file

@ -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>

View file

@ -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')

1886
po/sl.po

File diff suppressed because it is too large Load diff

15967
po/sr.po

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -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);
} }

View file

@ -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

View file

@ -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);
} }

View file

@ -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,

View file

@ -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) {

View file

@ -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);

View file

@ -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;
GFileInfo *info;
GPtrArray *confs; GPtrArray *confs;
const char *name; 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;
} }
@ -1341,7 +1335,6 @@ read_entire_config(const NMConfigCmdLineOptions *cli,
/* 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,

View file

@ -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,

View file

@ -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);

View file

@ -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",

View file

@ -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));

View file

@ -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

View file

@ -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,

View file

@ -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.
* *

View file

@ -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>

View file

@ -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));
if (flag == NM_CONNECTION_SERIALIZE_ALL)
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, TRUE, TRUE, FALSE); _rndt_wg_peers_assert_equal(s_wg2, wg_peers, TRUE, TRUE, FALSE);
else if (flag == NM_CONNECTION_SERIALIZE_WITH_NON_SECRET) } else if (flag == NM_CONNECTION_SERIALIZE_WITH_NON_SECRET) {
con2 = _connection_new_from_dbus_strict(con_var, FALSE);
s_wg2 = NM_SETTING_WIREGUARD(
nm_connection_get_setting(con2, NM_TYPE_SETTING_WIREGUARD));
_rndt_wg_peers_assert_equal(s_wg2, wg_peers, FALSE, FALSE, TRUE); _rndt_wg_peers_assert_equal(s_wg2, wg_peers, FALSE, FALSE, TRUE);
else
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,

View file

@ -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);

View file

@ -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;
} }

View file

@ -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 {

View file

@ -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 " \

View file

@ -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.")

View file

@ -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;
} }

View file

@ -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 &quot;may-fail&quot; 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 &quot;may-fail&quot; 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 &quot;may-fail&quot; 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 &quot;may-fail&quot; 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)" />

View file

@ -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',

View file

@ -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

View file

@ -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 */

View file

@ -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,8 +93,8 @@ 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))
@ -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;
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; NmtNewtWidget *entry;
if (priv->list_type == NMT_ADDRESS_LIST_IP4_WITH_PREFIX) { 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,9 +163,9 @@ 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;
@ -165,9 +178,9 @@ 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);
@ -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
View 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 */

View file

@ -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)
@ -48,7 +48,8 @@ typedef struct {
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,

View file

@ -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)

View file

@ -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,

View file

@ -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,

View file

@ -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.

View file

@ -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;