Due to various ordering issues in ModemManager, when the Enable()
call fails because a PIN is required, MM will disable the modem
and *then* complete the dbus call. That means that NM gets the
Enable property change before the Enable() call completes, and NM
would then transition the device to DISCONNECTED. What we
really want to do is get the response from MM and then figure out
whether to fail activation or get secrets, not go to DISCONNECTED.
To fix this, ignore Enabled property changes to FALSE while
activating so we can handle it ourselves. There are still a few
fixes left in nm-applet to make the secrets request for PINs work
on-the-fly, but saved in the connection works fine.
If the user has already mapped the hostname to some other address,
assume the user knows what they are doing (since they probably do)
and leave that mapping alone, and create a minimal 127.0.0.1 entry.
If there was no hostname mapping, add it to the 127.0.0.1 entry
like NM did before.
Having the original hostname checks in the settings-service code
didn't allow the policy enough granularity to differentiate between
a plugin-provided hostname and the original hostname. We want to
fall back to the original hostname if there isn't a persistent
hostname (from a plugin) and if there isn't a DHCP-provided
hostname. Moving the original hostname checks to the policy
makes that possible. Clarify the precedence order at the same
time, and minimally validate the DHCP hostname as well.
Sometimes cause the cache not to refill with all interfaces,
meaning NM sometimes got the wrong carrier state from the
kernel which prevented NM from taking over existing connections.
keys- and route- files weren't passing the should_ignore_file()
check in dir_changed() because should_ignore_file() was only
taking ifcfg- files into account. Generalize most of the ifcfg name
handling functions so that should_ignore_file() will now handle
all three variants.
Add testcases to ensure that the name handling does what we want
it to, and optimize memory usage of utils_get_ifcfg_name() a bit.