On devices that have no real permanent hardware address (as returned
by ethtool), we take the current MAC address of the device.
Currently, NM is a bit flaky about whether to accept such fake permanent
addresses for settings like keyfile.unmanaged-devices or the per-
connection property ethernet.mac-address. Probably, we should allow
using fake addresses there in general.
However, that leads to problems because NetworkManager itself changes
the current MAC address of such devices. For example when
configuing
keyfile.unmanaged-device=22:33:44:55:66:77
and later activating a connection with
ethernet.cloned-mac-address=22:33:44:55:66:77
we have a strange situation after restart and the device becomes
unmanaged.
We are going to avoid that, by remembering the fake permanent address
in the device state file.
This only matters:
- for devices that don't have a real permanent address (veth)
- if the user or NetworkManager itself changed the MAC address
of the device
- after a restart of NetworkManager, without reboot. A reboot
clears the device state for /var/run/NetworkManager.
_nm_utils_hwaddr_length() did a validation of the string
and returned the length of the address. In all cases where
we were interested in that, we also either want to validate
the address, get the address in binary form, or canonicalize
the address.
We can avoid these duplicate checks, by using _nm_utils_hwaddr_aton()
which both does the parsing and returning the length.
We usually don't build NM with g_assert() disabled (G_DISABLE_ASSERT).
But even if we would, there is no assertion macro that always evaluates
the condition for possible side effects.
I think that is a useful thing to have.
Since connection.autoconnect-slaves was introduced, we only allowed it
to autoactivate slaves for connections that were not slave themselves.
It seems useful to remove such limitation, but we must prevent an
infinite loop if there is a circular dependency between connections.
https://bugzilla.redhat.com/show_bug.cgi?id=1360386
This allows to get rid of the dhclient requirement of NetworkManager
package and moves the package dependency to the new sub package
NetworkManager-config-dhcp-dhclient.
For the moment, I think dhclient should still be the default choice for
regular users due to dhclient providing better better previledge separation
of network facing code. A user who knows that he's doing, can now however
remove dhclient while keeping NetworkManager.
https://bugzilla.redhat.com/show_bug.cgi?id=1204226
nm_settings_connection_set_autoconnect_blocked_reason() must be called
on the settings-connection. Fixes the following:
GLib-GObject-WARNING **: invalid cast from 'NMSimpleConnection' to 'NMSettingsConnection'
Fixes: 06da353242
When running under load (e.g. with parallel make and valgrind
enabled), the checked time interval might be too short. Relax
the assertion
NetworkManager:ERROR:src/tests/test-general-with-expect.c:65:test_nm_utils_monotonic_timestamp_as_boottime: assertion failed (now_boottime_2 - now_boottime <= NM_UTILS_NS_PER_SECOND / 1000): (15156494 <= 1000000)
On D-Bus level, string (s) or object paths (o) cannot be NULL.
Thus, whenver server exposes such an object, it gets automatically
coerced to "" or "/", respectively.
On client side, libnm should coerce certain properties back, for which
"" is just not a sensible value.
For example, an empty NM_DEVICE_ETHERNET_HW_ADDRESS should be instead
exposed as NULL.
Technically, this is an API change. However, all users were well advised
to expect both NULL and "" as possible return values and handle them
accordingly.
It was a macro to pass on the non-const-ness of the argument, but
that just doesn't make sense.
That is a signature
char *nm_str_not_empty (char *)
does not make sense, because you cannot transfer ownership
conditionally without additional checks to avoid a leak. Which makes
this form is pointless. For example:
char *
foo (void)
{
char *s;
s = _create_value ();
return nm_str_not_empty (s); /* leaks "" */
}
When a global checkpoint is created (one with empty device list) we
save the status of all devices to restore it later. After the
checkpoint new interfaces and connections may appear and they can
significantly influence the overall networking status, but we don't
consider them at the moment.
Introduce a new flag DELETE_NEW_CONNECTIONS to delete any connection
added after the checkpoint and similarly a DISCONNECT_NEW_DEVICES to
ensure that the connection active on newly appeared devices doesn't
disrupt network connectivity.
https://bugzilla.redhat.com/show_bug.cgi?id=1378393
The user can configure the configuration paths via command line
arguments. If the user configures /var/run/NetworkManager/conf.d
as --system-config-dir or --config-dir, avoid using it as run-config
directory.
Yes, this doesn't catch
NetworkManager --config-dir=/etc/NetworkManager/conf.d \
--system-config-dir=/etc/NetworkManager/conf.d/
This is useful for configuration that gets auto-generated from another source.
These are then not primary configuration files and thus should not be put into
/etc.
This mirrors the structure of udev rules or systemd units, which can also be in
/usr, /run/, or /etc/.
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
https://bugzilla.gnome.org/show_bug.cgi?id=773069
Some cleanup of the toplevel Makefile.am.
The aim it to build every source file only once. That saves compilation
time, but more importantly it guarantees that there are no differing CFLAGS
and all users use exactly the same binary.
NetworkManager and nm-iface-helper compiled nm-dhcp-manager.c twice,
the latter with setting -DNM_DHCP_INTERNAL_ONLY to only enable the
internal plugin.
Change that to compile nm-dhcp-manager.c once for both users
by putting it into libNetworkManagerBase.
We only needed proper glib enum types for having properties
and signal arguments. These got all converted to plain int,
so no longer generate such an enum type.
Depending on how arguments are passed to the called function,
this could lead to a crash.
Maybe not on 32 bit machines where the size of the pointer is
the size of an int.
Maybe not on x86_64, where the arguments are passed in registers.
Fixes: b88c309167