Change the way that nm-properties-changed-signal works, and parse the
dbus-binding-tool-generated info to get the exact list of properties
that it's expected to export.
This makes NM_PROPERTY_PARAM_NO_EXPORT unnecessary, and also fixes the
problem of properties like NMDevice:hw-address being exported on
classes where it shouldn't be.
And change src/main.c to use the local allocation macros. This
results in much cleaner code, as one can see from the diff.
Because libgsystem is designed for nonrecursive make, it fits best in
the current recursive setup if we build . first. This will be a lot
nicer when we switch NM to a nonrecursive setup.
Reverts part of
2226a00cc2
core: add a "default-unmanaged" setting for devices
Newly-created master interfaces are in the UNAVAILABLE state, but if
they were created in response to a slave connection being activated,
the master must be activated immediately too. But a device cannot
be activated unless it's in the DISCONNECTED state, so restore that
state change.
nm_device_release_one_slave() may change the list head, but the
for loop in nm_device_master_release_slaves() can't handle that.
Use a while loop instead.
Same fix as in commit 195a09d7c0.
NL_AUTO_PROVIDE is not a valid flag for this call and it's coincidental
with ROUTE_CACHE_CONTENT, which is not what we want.
One result arising from this fix is that per-device routes are now
assigned priorities correctly. This means, for instance, you can have a
wired and wireless connection on the same network, and have the wired
connection always take precedence whilst it's available.
Signed-off-by: Michael Chapman <mike@very.puzzling.org>
If a kernel interface changes its MAC address, and NM is not
supposed to manage that interface, ifupdown needs to notice
that MAC address change and tell NM that the unmanaged devices
have changed, so that NM continues to not touch the device
after the MAC has changed.
well_known_interfaces -> eni_ifaces, since it's a hash of any
interfaces read from /etc/network/interfaces.
well_known_ifaces -> kernel_ifaces, since it's a hash of any
network subsystem interface the kernel knows about
'iface_connections' is really the list of all NMIfupdownConnections
known to the plugin, read from /e/n/i and hashed by block name. Since
ifupdown doesn't store anything *except* connections from /e/n/i,
just rename it to 'connections' to reduce confusion with the
well_known_interfaces and well_known_ifaces hashes.
It *is* legitimate to (re-)activate a connection on an already-active
device, so remove the newly-added "sanity check" preventing that.
Pointed out by jklimes.
If for some reason the connection is disrupted and the AP rejects
reconnection attempts (perhaps the driver has a bug, you get
disconnected, and the AP rejects association because it thinks
you're already associated), the AP object was being removed from
the scan list by code meant to handle out-of-range or turned-off
APs. Thus even though the AP was in-range, it wouldn't be
found and the connection retried until the next scan.
Instead, only remove the AP object from the scan list if the
supplicant hasn't been able to exchange any frames with the
AP. This preserves the out-of-range handling, becuase the
supplicant wouldn't be able to talk to the AP and thus
'ssid_found' will be FALSE, and also ensures that an in-range
but confused AP says in the scan list and will be retried
immediately.
This will help to store more link attributes in NMFakePlatform link
array than in public NMPlatformLink array. Some of the future
attributes will not be part of the NMPlatform API.
Although having different parts of NM in different subdirectories
keeps the source tree neat, it has made the build messy, particularly
because of cross-dependencies between the subdirs.
Reorganize to build all of the pieces of the NetworkManager binary
from src/Makefile, and only use recursive make for test programs,
helper binaries, and plugins.
As part of this, get rid of all the per-directory convenience
libraries, and switch to building a single top-level
libNetworkManager.la, containing everything except main.c, which all
of the test programs can then link against.
Due to recent changes not all settings plugins send an IP config setting
when the method is 'auto'. Some old code in the NMDevice IP config paths
mishandled this. Fix that up; the expected behavior should be:
1) if the device is a slave, IP configuration is DISABLE/IGNORED
2) if the connection has an IP4 or IP6 setting, use the setting's method
3) default to AUTO
The bits in the result of ETHTOOL_GFEATURES are not in any defined
order; you need to use ETHTOOL_GSTRINGS to get the names associated
with each bit to find what each one does. Fix
NMPlatformLinux:link_supports_vlans() to do this.
https://bugzilla.gnome.org/show_bug.cgi?id=699649
Add a new libnm-glib method to get the type description for a device,
and use it in nmcli. For most types, the type description is based on
the class name, but for NMDeviceGeneric, it comes from the
:type-description property.
Add NMDeviceGeneric, to provide generic support for unknown device
types, and create NMDeviceGenerics for those devices that NM
previously was ignoring. Allow NMSettingGeneric connections to be
activated on (managed) NMDeviceGenerics.
Allow devices to declare themselves unmanaged-by-default, but tweak
nm-manager and nm-policy to allow activating matching connections on
those devices anyway.
(This ensures that NM keeps its hands completely off the device unless
the user explicitly asks it to do something with it.)
Now that NMDevice reads the hwaddr directly from netlink, it's silly
to have every device subtype maintain its own hw-address property
(using data that it gets from the NMDevice base class).
Remove all the device-specific hw-address properties, and add one to
NMDevice instead. (Because of the way nm-properties-changed-signal
works, this has no effect on the D-Bus API.) Subclasses now call
nm_device_get_hw_address() in places where they used to just refer to
priv->hw_addr (and to simplify this, we now allow passing NULL for the
out length parameter, since the subclasses almost always know what the
length will be already).
Also reorganize/simplify a few other methods to take advantage of the
fact that NMDevice is now keeping track of the hw-address directly.
https://bugzilla.gnome.org/show_bug.cgi?id=699391
This is a simple testing tool. Even though it includes a basic help (just run
it without arguments), the command syntax often requires looking into the
code. Use it whenever you want to test specific behavior of nm-platform.
For regular tests, please amend the automatic testsuite instead.
On Linux, the gateway attribute is not a key attribute and therefore is
not necessary for functions that just need to identify a route. This may
be revisited when porting to other platforms but for now I want to keep
things simple.