NetworkManager/src/core/settings
Beniamino Galvani 164591f754 settings: preserve existing connection flags on update
We are passing to the plugin only 'sett_flags', which is the bitmask
of flags to change and works together with 'sett_mask'; however,
plugins interpret that value as the new flags value. The result is
that if there is no change needed (0/0), the existing flags are lost.
Simple reproducer:

  ip link add dummy1 type dummy
  ip link set dummy1 up
  ip addr add dev dummy1 fd01::12/64
  sleep 1

  # now, a external connection is created by NM

  echo "BEFORE:"
  cat /run/NetworkManager/system-connections/dummy1.nmconnection | grep "nm-generated\|volatile\|external"

  # just add a new address to the interface to make it lose
  # the external flag

  ip addr add dev dummy1 172.25.42.1/24
  sleep 1

  echo "AFTER:"
  cat /run/NetworkManager/system-connections/dummy1.nmconnection | grep "nm-generated\|volatile\|external"

Output:

  BEFORE:
  nm-generated=true
  volatile=true
  external=true
  AFTER:

Fixes: d35d3c468a ('settings: rework tracking settings connections and settings plugins')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1548
(cherry picked from commit 86b922695f)
(cherry picked from commit 4353f84230)
2023-03-02 11:25:39 +01:00
..
plugins ifcfg-rh: fix persisting all-default NMSettingEthtool with autoneg/wol flags 2022-11-10 13:49:30 +01:00
nm-agent-manager.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-agent-manager.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-secret-agent.c core: use NM_SHUTDOWN_TIMEOUT_1500_MSEC 2022-02-24 09:38:53 +01:00
nm-secret-agent.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-connection.c settings-connection: add a "plugin" argument to Update2() 2022-03-28 13:29:28 +02:00
nm-settings-connection.h settings-connection: add a "plugin" argument to Update2() 2022-03-28 13:29:28 +02:00
nm-settings-plugin.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-plugin.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-storage.c all: use nm_uuid_is_normalized() for checking valid UUID for "connection.uuid" 2021-06-04 09:29:23 +02:00
nm-settings-storage.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-utils.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-utils.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-settings.c settings: preserve existing connection flags on update 2023-03-02 11:25:39 +01:00
nm-settings.h settings-connection: add a "plugin" argument to Update2() 2022-03-28 13:29:28 +02:00