Commit Graph

30605 Commits

Author SHA1 Message Date
Thomas Haller
f5d9428468 platform/netlink: add netlink_protocol argument to nl_nlmsghdr_to_str()
The meaning of the header depends on the netlink protocol. Add that parameter,
so we can also handle genl.
2022-06-17 19:40:37 +02:00
Thomas Haller
3ab66fd341 platform: move nl_recv() to separate function
Will be reused later.
2022-06-17 19:40:37 +02:00
Thomas Haller
2d211cfd5c platform: log information about (sync) genetlink socket 2022-06-17 19:40:37 +02:00
Thomas Haller
c7fea44e47 platform/trivial: rename netlink sockets in NMLinuxPlatform
- "priv->nlh" to "priv->sk_rtnl": as we also have an genl socket,
   "nlh" is not a good name. The point is that this is rtnetlink.
   Also, "h" sounds like a handle, that is, a file descriptor.
   Make this clearer with a "sk_" prefix.

- "priv->genl" to "priv->sk_genl_sync": This socket is only used for synchronous
   operations, that is, it is passed to various independent components, that use
   it to send a request and wait for the response (while consuming all messages).
   We will have a use for a second socket, hence the "_sync" part.
   The "sk_" prefix is for consistency with "sk_rtnl".

- "priv->event_source" to "priv->rtnl_event_source". Just make it
  clearer, that this is for the rtnetlink socket. In any case,
  this field is hardly used at all, it can have a sturdy name.
2022-06-17 19:40:36 +02:00
Thomas Haller
aa2fd36db4 platform: require generic netlink socket
Sockets are really a fundamental thing we require to operate.
We cannot meaningfully operate, if we fail to create them.
That is also why a too low file descriptor limit is fatal
and unsupported. This is similar with out of memory situations.

Just require that we always are able to create the generic
netlink socket.
2022-06-17 19:40:36 +02:00
Thomas Haller
9c8b957704 platform: drop _genl_sock() function and directly access data 2022-06-17 19:40:36 +02:00
Thomas Haller
67d64fd4e5 platform/netlink: also set NETLINK_EXT_ACK for genl socket
There are only two callers of nl_socket_new(). One for NETLINK_GENERIC
and one for NETLINK_ROUTE.

We already were enabling ext-ack for the rtnetlink socket. Also enable
it for the genl socket.

Do that, but just moving this inside nl_socket_new(). I cannot imagine a
case where we don't want this.
2022-06-17 19:40:36 +02:00
Thomas Haller
f96fbc8ebe platform/netlink: combine nl_socket_alloc() and nl_connect()
Create and use new nl_socket_new().

nl_socket_alloc() really does nothing but allocating the struct and
initializing the fd to -1. In all cases, we want to call nl_connect()
right after.

Combine the two. Then we also cannot  have a "struct nl_sock" without a
valid fd. This means several error checks can be dropped.

Note that former nl_connect() did several things at once. Maybe, for
more flexibility one would need to tweak what should be done there.
For now that is not necessary. In any case, if we need more flexibility,
then we would control what nl_connect() (now nl_socket_new()) does, and not
the split between nl_socket_alloc() and nl_connect().
2022-06-17 19:40:20 +02:00
Thomas Haller
4a22abdda1 platform/netlink: add nm_auto_nlsock cleanup macro 2022-06-17 19:38:57 +02:00
Thomas Haller
612528af89 libnm/docs: elaborate how ipv4.dns-search/ipv6.dns-search works 2022-06-17 19:32:41 +02:00
Beniamino Galvani
2807f6a893 dhcp: nettools: save the lease after it gets accepted
Currently the lease gets saved only on the extended (renewal)
event. Also save it after it gets accepted.

Fixes: 52a0fe584c ('dhcp/nettools: better track currently granted lease')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1261
2022-06-17 18:11:30 +02:00
Beniamino Galvani
393bc628ff dhcp: wait DAD completion for DHCPv6 addresses
Wait that addresses received through DHCPv6 complete duplicate address
detection before reporting that the lease can be used.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')

https://bugzilla.redhat.com/show_bug.cgi?id=2096386
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1258
2022-06-16 16:26:14 +02:00
Thomas Haller
7cfa8a01cd cli: reformat file to look better
Comments on the same line as field names are not rendered well by clang-format.
Even if manually edited, it seems not a preferable way to comment on a field.
Move the comment in the line before.
2022-06-16 11:02:20 +02:00
Thomas Haller
113fe2aaec build: add missing example files to "Makefile.examples" for dist 2022-06-16 09:41:01 +02:00
Thomas Haller
5218934244 build: sort files in Makefile.examples 2022-06-16 09:41:01 +02:00
liaohanqin
5f530904de feat: add example for wifi sae connection
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1247
2022-06-16 09:40:55 +02:00
Fernando Fernandez Mancera
3e4d084998 ifcfg-rh: fix wrong type for vint64 variable 2022-06-16 02:14:31 +02:00
Fernando Fernandez Mancera
87eb61c864 libnm: support wait-activation-delay property
The property wait-activation-delay will delay the activation of an
interface the specified amount of milliseconds. Please notice that it
could be delayed some milliseconds more due to other events in
NetworkManager.

This could be used in multiple scenarios where the user needs to define
an arbitrary delay e.g LACP bond configure where the LACP negotiation
takes a few seconds and traffic is not allowed, so they would like to
use nm-online and a setting configured with this new property to wait
some seconds. Therefore, when nm-online is finished, LACP bond should be
ready to receive traffic.

The delay will happen right before the device is ready to be activated.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1248

https://bugzilla.redhat.com/show_bug.cgi?id=2008337
2022-06-16 02:14:21 +02:00
Lubomir Rintel
c861a7e1d8 release: bump version to 1.39.7 (development) 2022-06-15 17:49:23 +02:00
Lubomir Rintel
1c17e55627 nmcli/devices: add "checkpoint" command
This is an interface to the Checkpoint/Restore functionality that's
available for quite some time. It runs a command with a checkpoint taken
and rolls back unless success is confirmed before the checkpoint times
out:

  $ nmcli dev checkpoint eth0 -- nmcli dev dis eth0
  Device 'eth0' successfully disconnected.
  Type "Yes" to commit the changes: No
  Checkpoint was removed.

The details about how it's used are documented in nmcli(1) and
nmcli-examples(7).
2022-06-15 12:26:08 +02:00
Lubomir Rintel
47eaf963e3 nmcli: be less insistant on exiting when readline() gets no input
When the input ends, we indeed eventually want to shut down.

Nevertheless, it might be that we terminated the input *because* we're
already shutting down and want do do our cleanup. Let's not take the
shortcut to nmc_exit() in case the main loop is no longer running.

This doesn't affect existing uses of nmc_readline(), but will be useful
in a future patch.
2022-06-15 12:13:26 +02:00
Lubomir Rintel
5f9d2927ed nmcli/devices: use GPtrArray from get_device_list() directly
This makes get_device_list() return an array of NMDevices with a
reference taken and a destroy notifier that unhooks disconnect_state_cb,
so that it could replace the GSList of the same utility used by
disconnect/delete commands.

Suggested-by: Thomas Haller <thaller@redhat.com>
2022-06-15 12:13:26 +02:00
Lubomir Rintel
2074b28976 nmcli/devices: return GPtrArray instead of GSList from get_device_list()
A pointer array is slightly more efficient here, since we don't really
need the ability to insert elements in the middle. In fact, we'd prefer
if we could just add to the end, so that we'd spare some callers from a
need to do a g_slist_reverse().

Even though that alone being a good reason to use a GPtrArray instead of
GSList, I'm doing this for so that I could actually use the returned value
as-is in a call to nm_client_checkpoint_create() in a future patch.
2022-06-15 12:13:26 +02:00
Lubomir Rintel
767afeffd8 nmcli/devices: make get_device_list() terminate on "--"
Don't consider "--" a device name. Instead, treat it as a signal to stop
reading the device list.

If a caller expects nothing beyond the device names, it now has to
check.
2022-06-15 12:13:26 +02:00
Lubomir Rintel
d576f4df44 nmcli/devices: make get_device_list() shift argc/argv
Prior to this patch, get_device_list() would give the caller no clue
about how many options did it consume. That is okay -- it would always
process all argument until the end, so the no callers would really care.

In a further patch, I'd like to allow termination of the device name
list (with a "--" arguments), so it will be possible to specify further
arguments.

Let's change the protype of this routine to use pointers to argc/argv,
that it will be possible to adjust them.
2022-06-15 12:13:26 +02:00
Lubomir Rintel
e2fc81e211 glib-aux: add g_ptr_array_find() compat routine
I want it but GLib is no good. Sad.
2022-06-15 12:13:26 +02:00
Ryosuke YASUOKA
7d499c4da6 nmcli: add nmcli gen reload usage
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1257

Signed-off-by: Ryosuke Yasuoka <yasuoka0830@gmail.com>
2022-06-15 08:16:33 +02:00
Lubomir Rintel
e5301e9ae8 merge: branch 'lr/cancel-ip-state-with-activation'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1245
2022-06-14 14:22:18 +02:00
Lubomir Rintel
1f61f3f239 device: release slaves when an external device is going managed
When we're deactivating an externally created device that has a master
because we're activating a connection on it, actually remove the device
from the master. Otherwise unpleasant things happen:

  active-connection[0x55ed7ba78400]: constructed (NMActRequest, version-id 4, type managed)
  device[0a458361f9fed8f5] (dummy0): sys-iface-state: external -> managed
  device[0a458361f9fed8f5] (dummy0): queue activation request waiting for currently active connection to disconnect
  device (dummy0): disconnecting for new activation request.
  device (dummy0): state change: activated -> deactivating (reason 'new-activation', sys-iface-state: 'managed')
  device (br0): master: release one slave 0a458361f9fed8f5/dummy0 (enslaved)(no-config)

Note the "no-config" above. We'set priv->master = NULL, but didn't
communicate the change to the platform. I believe this is not good.
This patch changes that.

  device (br0): bridge port dummy0 was detached
  device (dummy0): released from master device br0
  active-connection[0x55ed7ba782e0]: set state deactivating (was activated)
  device (dummy0): ip4: set state none (was done, reason: ip-state-clear)
  device (dummy0): ip6: set state none (was done, reason: ip-state-clear)
  device (dummy0): state change: deactivating -> disconnected (reason 'new-activation', sys-iface-state: 'managed')

  platform: (dummy0) emit signal link-changed changed: 102: dummy0
      <NOARP,UP,LOWER_UP;broadcast,noarp,up,running,lowerup> mtu 1500 master 101 arp 1 dummy* init
       addrgenmode none addr EA:8D:DD:DF:1F:B7 brd FF:FF:FF:FF:FF:FF driver dummy rx:0,0 tx:39,4746

Now the platform sent us a new link, the "master" property is still set.

  device[0a458361f9fed8f5] (dummy0): queued link change for ifindex 102
  device[0a458361f9fed8f5] (dummy0): deactivating device (reason 'new-activation') [60]
  device (dummy0): ip: set (combined) state none (was done, reason: ip-state-clear)
  config: device-state: write #102 (/run/NetworkManager/devices/102); managed=managed, perm-hw-addr-fake=EA:8D:DD:DF:1F:B7, route-metric-default=0-0
  active-connection[0x55ed7ba782e0]: set state deactivated (was deactivating)
  active-connection[0x55ed7ba782e0]: check-master-ready: already signalled (state deactivated, master 0x55ed7ba781c0 is in state activated)
  device (dummy0): Activation: starting connection 'dummy1' (ec6fca51-84e6-4a5b-a297-f602252c9f69)
  device[0a458361f9fed8f5] (dummy0): activation-stage: schedule activate_stage1_device_prepare

  l3cfg[ae290b5c1f585d6c,ifindex=102]: emit signal (platform-change-on-idle, obj-type-flags=0x2a)
  device (br0): master: add one slave 0a458361f9fed8f5/dummy0

Amidst the new activation we're processing the netlink message we got.
We set priv->master back, effectively nullifying the release above. Sad.

  device (dummy0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
  device[0a458361f9fed8f5] (dummy0): add_pending_action (2): 'in-state-change'
  active-connection[0x55ed7ba78400]: set state activating (was unknown)
  manager: NetworkManager state is now CONNECTING
  active-connection[0x55ed7ba78400]: check-master-ready: not signalling (state activating, no master)
  device[8fff58d61c7686ce] (br0): slave dummy0 state change 30 (disconnected) -> 40 (prepare)
  device[0a458361f9fed8f5] (dummy0): remove_pending_action (1): 'in-state-change'
  device (br0): master: release one slave 0a458361f9fed8f5/dummy0 (not enslaved) (force-configure)
  platform: (dummy0) link: releasing 102 from master 'br0' (101)
  device (br0): detached bridge port dummy0

Now things go south. The stage1 cleans the device up, removing it from
the master and the device itself decides it should deactivate itself
because it lots its master regardless of the fact that it should not
have one and it's in fact an unwanted carryover from previous activation.
I believe this is also wrong.

  device[0a458361f9fed8f5] (dummy0): Activation: connection 'dummy1' master deactivated
  device (dummy0): ip4: set state none (was pending, reason: ip-state-clear)
  device (dummy0): ip6: set state none (was pending, reason: ip-state-clear)
  device[0a458361f9fed8f5] (dummy0): add_pending_action (2): 'queued-state-change-deactivating'
  device[0a458361f9fed8f5] (dummy0): queue-state[deactivating, reason:connection-assumed, id:298]: queue state change
  device[0a458361f9fed8f5] (dummy0): activation-stage: synchronously invoke activate_stage2_device_config
  device (dummy0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')

Now things are really weird. We synchronously go to config, effectively
overriding the queued deactivation. We've really messed up.
2022-06-14 14:21:53 +02:00
Lubomir Rintel
1fe8166fc9 device: only deactivate when the master we've enslaved to goes away
Sometimes weird things happen.

Let dummy0 be an externally created device that has a master. We decide
to activate a connection that has no master on it:

  active-connection[0x55ed7ba78400]: constructed (NMActRequest, version-id 4, type managed)
  device[0a458361f9fed8f5] (dummy0): sys-iface-state: external -> managed
  device[0a458361f9fed8f5] (dummy0): queue activation request waiting for currently active connection to disconnect
  device (dummy0): disconnecting for new activation request.
  device (dummy0): state change: activated -> deactivating (reason 'new-activation', sys-iface-state: 'managed')
  device (br0): master: release one slave 0a458361f9fed8f5/dummy0 (enslaved)(no-config)

Note the "no-config" above. We'set priv->master = NULL, but didn't
communicate the change to the platform. I believe this is not good.

  device (br0): bridge port dummy0 was detached
  device (dummy0): released from master device br0
  active-connection[0x55ed7ba782e0]: set state deactivating (was activated)
  device (dummy0): ip4: set state none (was done, reason: ip-state-clear)
  device (dummy0): ip6: set state none (was done, reason: ip-state-clear)
  device (dummy0): state change: deactivating -> disconnected (reason 'new-activation', sys-iface-state: 'managed')

  platform: (dummy0) emit signal link-changed changed: 102: dummy0
      <NOARP,UP,LOWER_UP;broadcast,noarp,up,running,lowerup> mtu 1500 master 101 arp 1 dummy* init
       addrgenmode none addr EA:8D:DD:DF:1F:B7 brd FF:FF:FF:FF:FF:FF driver dummy rx:0,0 tx:39,4746

Now the platform sent us a new link, the "master" property is still set.

  device[0a458361f9fed8f5] (dummy0): queued link change for ifindex 102
  device[0a458361f9fed8f5] (dummy0): deactivating device (reason 'new-activation') [60]
  device (dummy0): ip: set (combined) state none (was done, reason: ip-state-clear)
  config: device-state: write #102 (/run/NetworkManager/devices/102); managed=managed, perm-hw-addr-fake=EA:8D:DD:DF:1F:B7, route-metric-default=0-0
  active-connection[0x55ed7ba782e0]: set state deactivated (was deactivating)
  active-connection[0x55ed7ba782e0]: check-master-ready: already signalled (state deactivated, master 0x55ed7ba781c0 is in state activated)
  device (dummy0): Activation: starting connection 'dummy1' (ec6fca51-84e6-4a5b-a297-f602252c9f69)
  device[0a458361f9fed8f5] (dummy0): activation-stage: schedule activate_stage1_device_prepare

  l3cfg[ae290b5c1f585d6c,ifindex=102]: emit signal (platform-change-on-idle, obj-type-flags=0x2a)
  device (br0): master: add one slave 0a458361f9fed8f5/dummy0

Amidst the new activation we're processing the netlink message we got.
We set priv->master back, effectively nullifying the release above.

  device (dummy0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
  device[0a458361f9fed8f5] (dummy0): add_pending_action (2): 'in-state-change'
  active-connection[0x55ed7ba78400]: set state activating (was unknown)
  manager: NetworkManager state is now CONNECTING
  active-connection[0x55ed7ba78400]: check-master-ready: not signalling (state activating, no master)
  device[8fff58d61c7686ce] (br0): slave dummy0 state change 30 (disconnected) -> 40 (prepare)
  device[0a458361f9fed8f5] (dummy0): remove_pending_action (1): 'in-state-change'
  device (br0): master: release one slave 0a458361f9fed8f5/dummy0 (not enslaved) (force-configure)
  platform: (dummy0) link: releasing 102 from master 'br0' (101)
  device (br0): detached bridge port dummy0

Now stage1 cleans the device up, removing it from the master.

  device[0a458361f9fed8f5] (dummy0): Activation: connection 'dummy1' master deactivated
  device (dummy0): ip4: set state none (was pending, reason: ip-state-clear)
  device (dummy0): ip6: set state none (was pending, reason: ip-state-clear)
  device[0a458361f9fed8f5] (dummy0): add_pending_action (2): 'queued-state-change-deactivating'

We decide to deal with this by enqueuing a deactivation. That is not
great -- we shouldn't even have had this master!

This patch takes the deactivation path only if we were willingly
enslaved to the master in question.
2022-06-14 14:21:53 +02:00
Lubomir Rintel
0fa8c5f94c device: stop checking the IP configuration state when cancelling activation
The @bond_mode_8023ad test has been seen failing, with a log like this:

  <debug> [...3.0484] device[...] (eth1): Activation: connection 'bond0.0' master deactivated
  <debug> [...3.0484] device[...] (eth1): add_pending_action (2): 'queued-state-change-deactivating'
  <debug> [...3.0484] device[...] (eth1): queue-state[deactivating, reason:new-activation, id:709]: queue state change

What happened is that eth1 has been activating. It was already enslaved
to a bond and was in an ip-config state when the bond was removed.
A change to "deactivating" state has been enqueued. But then this
happened:

  <trace> [...3.0942] device[...] (eth1): ip4: check-state: state done => done, is_failed=0, is_pending=0,
                      is_started=0 temp_na=0, may-fail-4=1, may-fail-6=1; disabled4; manualip4=done; ignore6 manualip6=done
  <trace> [...3.0942] device[...] (eth1): ip: check-state: (combined) state pending => done
  <debug> [...3.0943] device[...] (eth1): ip: set (combined) state done (was pending, reason: check-ip-state)
  <info>  [...3.0943] device (eth1): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
  <debug> [...3.0943] device[...] (eth1): add_pending_action (3): 'in-state-change'
  <debug> [...3.0943] device[...] (eth1): queue-state[deactivating, reason:new-activation, id:709]: clear queued state change

The IP config succeeded and the queued "deactivating" change was
overriden by the IP4 check result, prompting a change to "ip-check".
With the master still missing. Not good.

Let's terminate the appempts to check the IP state when we cancel the
activation, so that it doesn't override the enqueued state change.

Fixes-test: @bond_mode_8023ad

https://bugzilla.redhat.com/show_bug.cgi?id=2080928
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1245
2022-06-14 14:21:53 +02:00
Beniamino Galvani
d98d72c061 merge: branch 'bg/ppp-race-rh2085382'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1240
https://bugzilla.redhat.com/show_bug.cgi?id=2085382
2022-06-14 12:29:40 +02:00
Beniamino Galvani
b41b11d613 ppp: don't remove addresses from interface while IPCP/IPV6CP is running
pppd also tries to configure addresses by itself through some
ioctls. If we remove between those calls an address that was added,
pppd fails and quits.

To avoid this race condition, don't remove addresses while IPCP and
IPV6CP are running. Once pppd sends an IP configuration, it has
finished configuring the interface and we can proceed normally.

https://bugzilla.redhat.com/show_bug.cgi?id=2085382
2022-06-14 12:26:21 +02:00
Beniamino Galvani
e8275d7139 core: add nm_l3cfg_block_obj_pruning()
Add a function prevent the removal of addresses and routes from the
interface for a given address family.
2022-06-14 12:26:21 +02:00
Beniamino Galvani
d6429d3ddb device: ensure DHCP is restarted every time the link goes up
Currently we call nm_device_update_dynamic_ip_setup() in
carrier_changed() every time the carrier goes up again and the device
is activating, to kick a restart of DHCP.

Since we process link events in a idle handler, it can happen that the
handler is called only once for different events; in particular
device_link_changed() might be called once for a link-down/link-up
sequence.

carrier_changed() is "level-triggered" - it cares only about the
current carrier state. nm_device_update_dynamic_ip_setup() should
instead be "edge-triggered" - invoked every time the link goes from
down to up. We have a mechanism for that in device_link_changed(), use
it.

Fixes-test: @ipv4_spurious_leftover_route

https://bugzilla.redhat.com/show_bug.cgi?id=2079406
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1250
2022-06-11 18:24:00 +02:00
Thomas Haller
d15f5420c7 contrib: use less -f in NM-log to avoid prompt for non-text input 2022-06-10 08:24:58 +02:00
Thomas Haller
c6228a5815 contrib: install iproute-tc in "nm-in-container.sh" 2022-06-09 21:11:08 +02:00
Beniamino Galvani
31d7131126 ppp: merge branch 'ppp-ip6-dns'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1254
2022-06-09 16:22:47 +02:00
Dominique Martinet
4d7b494eb3 ppp-manager: ip6: set interface mtu based on ppp config
impl_ppp_manager_set_ip4_config always has been setting interface mtu
based on ppp configuration: do the same for ip6 in case it matters.
2022-06-09 14:21:10 +00:00
Dominique Martinet
6991333bc0 ppp-manager: ip6: fix dns not being used
ipv6 DNS received on ppp interface were being ignored because their
priority was not set.
Fix this by using default priority in impl_ppp_manager_set_ip6_config(),
as was done for ip4_config in b2e559fab2 ("core: initialize l3cd
dns-priority for ppp and wwan")

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1022
2022-06-09 14:21:10 +00:00
Thomas Haller
431d139d15 dispatcher: log duration of dispatcher call
Yes, we anyway log the timestamps for every log message. So one could
always calculate the offset. However, when you read a logfile, it can be
cumbersome to stop looking at where you currently are to find the
start/end of a call. For convenience, log the duration explicitly.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1251
2022-06-09 13:23:35 +02:00
Thomas Haller
058af5fd07 contrib: enable DHCPv6 in "m-in-container.sh"'s "nm-env-prepare.sh" 2022-06-09 12:08:18 +02:00
Thomas Haller
921af527f7 std-aux: cleanup NM_CMP_*() macros
- add code comments explaining some things.

- for NM_CMP_FIELD*() variants have a corresponding NM_CMP_DIRECT*()
  macro and use it (aside the "memcmp" variants, which don't translate
  directly).
2022-06-09 09:52:51 +02:00
Beniamino Galvani
f69a1cc874 device: fix memory leak
l3cd instances must be removed from the old l3cfg before calling
_cleanup_ip_pre(). Otherwise, _cleanup_ip_pre() unregisters them from
the device, and later _dev_l3_register_l3cds(self, l3cfg_old, FALSE,
FALSE) does nothing because the device doesn't have any l3cd.

Previously the l3cds would linger in the l3cfg, keeping a reference to
it and causing a memory leak; the leak was not detected by valgrind
because the l3cfg was still referenced by the NMNetns.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
Fixes-test: @stable_mem_consumption2

https://bugzilla.redhat.com/show_bug.cgi?id=2083453

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1252
2022-06-09 09:37:24 +02:00
Thomas Haller
8e86cfb8ab l3cfg: fix comparing "has-dns-priority" flag in nm_l3_config_data_cmp_full()
Fixes: cb29244552 ('core: support compare flags in nm_l3_config_data_cmp_full()')
2022-06-09 08:53:34 +02:00
Thomas Haller
b93750d4c5 contrib: set git-blame options in "nm-setup-git.sh" 2022-06-08 21:27:57 +02:00
Thomas Haller
fb2b35b068 ifcfg: set errno for svGetValueEnum() to detect unset values 2022-06-07 09:55:39 +02:00
Thomas Haller
8c6d89f937 n-dhcp4: re-import git-subtree for 'src/n-dhcp4'
git subtree pull --prefix src/n-dhcp4 git@github.com:nettools/n-dhcp4.git master --squash
2022-06-07 09:08:34 +02:00
Thomas Haller
e38f0be736 Squashed 'src/n-dhcp4/' changes from e4af93228e37..7db7dc4bab53
7db7dc4bab53 probe: merge branch 'th/decline-fixes'
bb61737788dd probe: fix internal state after declining lease
c5d0f38ab7a9 probe: maintain the probe's lease list in "n-dhcp4-c-probe.c"
48bf2788336e probe: return error when calling accept/decline/select in unexpected state

git-subtree-dir: src/n-dhcp4
git-subtree-split: 7db7dc4bab5312218135464d8550a86845ca6fdd
2022-06-07 09:08:21 +02:00
Thomas Haller
12ea3bb425 contrib: don't use :Z for bind mounts in "nm-in-container.sh"
I am not sure why I added this. I think it's not necessary or
useful. Drop it.
2022-06-03 15:03:13 +02:00