[Networkmanager] manual method and may-fail default

Beniamino Galvani bgalvani at redhat.com
Mon Aug 28 12:19:20 UTC 2023


On Sat, Aug 19, 2023 at 02:06:23PM +0200, Adam Majer wrote:
> Hi all,
> 
> By default, any connection method is set to may-fail=true, even when the
> method is manual. This results in funny errors -- for full discussion please
> see suse's bugzilla [1].

> The question here is whether this actually makes sense. Wouldn't it make
> more sense that when the method is set to "manual" that "may-fail" is then
> reset to "false" if it still has the default value? Manual IP assignments
> should really not fail. Current setting is rather counterintuitive in such a
> scenario.

For IPv4, a static address is immediately available after it's
configured. Changing the may-fail value is not very useful because in
practice the static configuration always succeeds immediately.

Static IPv6 addresses need to go through duplicate address detection
(DAD) which lasts some seconds and in the meantime they are marked by
kernel as "tentative" which means that they are not really usable (for
example, a bind() on that address fails). I think this is the problem
you are seeing, as DHCPv4 completes before IPv6 DAD and then the
connection goes up (because ipv6.may-fail=yes) unblocking
NetworkManager-wait-online.

The may-fail property is a boolean with default value TRUE; changing
the default value to FALSE only when there are static addresses
doesn't seem easy. Users still needs to be able to override the value
to TRUE in case e.g. they only need to wait for a specific address
family. So, NetworkManager can't just ignore the property when using
static addresses.

Maybe clients that create the profile (for example, nmcli) could
initialize the property to FALSE in case of method=manual, but it
would be confusing that some clients apply a different default value
than others.

In the end, I think this requires configuration from users. If you are
setting up a service that binds on IPv4 or IPv6, set may-fail=no on
the corresponding address family. This is documented in `man
NetworkManager-wait-online`; if that is not clear enough, please
suggest how to improve it or file an issue.

Beniamino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/networkmanager/attachments/20230828/19bc5b7a/attachment.sig>


More information about the Networkmanager mailing list