device: assume matching connections during first start

System Internals / NetworkManager - Thomas Haller [] - 20 April 2017 08:20 EDT

Since commit 2d1b85f (th/assume-vs-unmanaged-bgo746440), we clearly distinguish between two modes when encountering devices with external IP configuration: a) external devices. For those devices we generate a volatile in-memory connection and pretend it's active. However, the device must not be touched by NetworkManager in any way. b) assume, seamless take over. Mostly for restart of NetworkManager, we activate a connection gracefully without going through an down-up cycle. After the device reaches activated state, the device is considered fully managed. For this only an existing, non volatile connection can be used.

Before 'th/assume-vs-unmanaged-bgo746440', the behaviors were not clearly separated.

Since then, we only choose to assume a connection (b) when the state file indicates a matching connection. Now, extend this to also assume connections when:

- during first-start (not after a restart) when there is no state file yet.- and, if we have an existing, non volatile, connection which matches the device's configuration.

This patch lets NetworkManager assume connection also on first start. That is for example useful when handing over network configuration from initrd.

This only applies to existing, permanent, matching(!) connections, so it is a good guess that the user wants NM to take over this interface. This brings us closer to the previous behavior before 'th/assume-vs-unmanaged-bgo746440'.

27b2477 device: assume matching connections during first start
src/nm-manager.c | 90 +++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 66 insertions(+), 24 deletions(-)


  • Share