Thomas points out that the previous refactoring moved the
link_changed() virtual method invocation relative to
update_for_ip_ifname_change(), which could have weird side effects
given the things that can happen there. So move it back.
Previously, we always lookup the cache for libnl objects and used those for
delete_object(). This was necessary, because libnl guesses and overwrites
the IPv4 route scope.
Newer libnl no longer overwrites the scope if set explicitly to RT_SCOPE_NOWHERE.
So, this workaround is no longer needed. Indeed there might be cases, where it is
harmful, because we might guess the wrong scope.
This was fixed in libnl3 in commits
85ec9c7ad8015c4ee59bhttps://bugzilla.gnome.org/show_bug.cgi?id=726273
Signed-off-by: Thomas Haller <thaller@redhat.com>
The libnl function nl_has_capability() was only added recently, so don't depend on it
at compile time. Instead use dlopen to load the function if the libnl library contains it.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Bond, bridge, and team were notifying their "slaves" properties before
the slave actually got removed from priv->slaves, meaning that
anything that looked at the property directly from a notify::slaves
handler would see the old value. Fix that.
Keep priv->slaves in the order that slaves were attached, rather than
in reverse order.
Among other things, this makes the errors from
nm_device_master_check_slave_physical_port() more consistent.
Commit a544aa374e extracts the wifi device
into a shared library. Update the (currently broken) default spec file to
build the new package NetworkManager-wifi.
Signed-off-by: Thomas Haller <thaller@redhat.com>
When plugins are disabled (which is configurable), the additional files
must be excluded. Otherwise rpmbuild fails with:
Installed (but unpackaged) file(s) found:
Signed-off-by: Thomas Haller <thaller@redhat.com>
For the factory, the only public symbols should be the factory functions.
For the WWAN library, the only public symbols should be those that
NMDeviceModem and NMDeviceBt use.
Instead of having a GObject property and a factory function to get
the plugin's device type, just use the factory function, since it
always has to be around.
The mesh and Wi-Fi companion share radio hardware and firmware resources
and you need both to exist for the mesh to function properly and to
ensure that the Wi-Fi and mesh sides cooperate correctly for scanning
and activation.
If the supplicant interface object never successfully initialized, remove
the pending action to prevent warnings about "pending action already added"
when supplicant_interface_acquire() adds the pending action again.
Just listen to manager signals all the time, but only respond to
them when necessary. Clean up companion detection to be a bit
clearer, and use nm_device_queue_state() so that we don't need
an idle handler when detecting the companion from a state change
handler.
to_string_link() logs link details and creates a new link to do this,
filling in the various filed in init_link(). init_link() attempts to
fill in the driver name, and might call ethtool to do that. Well,
ethtool API only accepts an interface name (which we don't have) and
not an ifindex (which we do have), and dies. Ensure that the ethtool
functions bail out instead of crashing if they don't get an interface
name.
Unfortunately, most callers of link_change() don't bother setting
ifindex or ifname on the link that ends up getting passed to
to_string_link(), because libnl doesn't require that when calling
rtnl_link_change(). Modify all callers to at least set the
ifindex so that to_string_link() has something useful to log.
NetworkManager[10651]: <info> (msh0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
NetworkManager[10651]: (platform/nm-linux-platform.c:684):link_extract_type: runtime check failed: (ifname != NULL)
NetworkManager[10651]: <error> [1398107504.807205] [platform/nm-linux-platform.c:1856] link_change(): Netlink error changing link 12: <UP> mtu 0 (1) driver 'usb8xxx' udi '/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/net/msh0': Message sequence number mismatch
at platform/nm-linux-platform.c:691
at platform/nm-linux-platform.c:1850
at devices/nm-device.c:5523
NM_DEVICE_STATE_REASON_NOW_MANAGED) at devices/nm-device.c:6662
at nm-manager.c:2115
There used to be many more members of the Supplicant struct, but now
that there are only three, collapse the struct into the NMDeviceWifiPrivate
struct, renaming them slightly at the same time to shorten the names.
Second, consolidate timeout cleanup since the two remaining timeouts
don't need their own cleanup functions.
Third, start_supplicant_connection_timeout() doesn't need its own
function since g_timeout_add() never returns 0, so we don't need to
check for it.
The only reason for the small struct was the idle handler, and the
only reason for the idle handler was to ensure that state was changed
from an idle handler. We've got nm_device_queue_state() to do that
for us now, so use it.
Make Wi-Fi support a plugin using the new device factory interface.
Provides a 7% size reduction in the core NM binary.
Before After
NM: 1154104 1071992 (-7%)
Wi-Fi: 0 110464
(all results from stripped files)
Older Intel "ipw" devices (ipw2100, ipw2200, and ipw2915) only gained
kernel rfkill subsystem integration with 2.6.33. Before then their
custom rfkill functionality had to be polled via sysfs. Since we now
require at least a 3.x kernel, remove this old code.