The AC doesn't get a D-Bus path until it's exported, but that happens after
it's handed to the Device it will be activated on. The Device emits a
PropertyChanged event when it's handed the AC, but it ignores ACs that
aren't exported yet. Thus when activating, the Device doesn't emit the
AC's path at all in the ActiveConnection property because it's NULL.
Fix that by exporting the AC immediately before starting activation
with it.
Second, move the notification of the Device.ActiveConnection property
to be emitted along with the state change to PREPARE instead of long
before it. While we don't guarantee signal ordering in general, this
seems like a more correct ordering.
https://bugzilla.gnome.org/show_bug.cgi?id=723783
If we find multiple plugins for the same type (eg, because the user
previously installed the "atm" and "bt" plugins, and didn't delete
them), log a warning.
The atm/adsl plugin really is a generic ATM plugin but (a) it needs a
bit of work to do IPoATM rather than just PPPoATM and PPPoEoATM, and
(b) most people currently using NM's ATM support are using DSL devices
not actual ATM cards anyway, and have no idea what "ATM" even means.
If we add the necessary IPoATM support later we can rename the plugin
back to -atm
nm_device_deactivate() is used when deactivating a device, but also
when initializing it when it is first managed. Rename it to
nm_device_cleanup(), and use a different log message ("preparing
device") in the NM_DEVICE_STATE_REASON_NOW_MANAGED case.
If a device had its carrier ignored, and did not have a carrier on startup,
then NetworkManager would not re-check autoconnect connections when the
device's carrier appeared. Because ignore-carrier devices are always
in DISCONNECTED state when they are managed, the nm-device.c::carrier_changed()
code essentially did nothing when the carrier appeared. It needs to
also trigger an auto-activation recheck signal when the carrier appears
to ensure that now-valid connections (like those that require DHCP or
IPv6) can be auto-activated.
When a VPN goes down, like at suspend, and the link has already
disappeared, the new platform logging code tries to print the
link information using a link object with only the ifindex filled
in. When adding/removing/changing links, internal code often fills
in just the ifindex (becuase that's all you need). Thus
to_string_link() will always fail if that operation fails.
at platform/nm-linux-platform.c:688
at platform/nm-linux-platform.c:1835
at vpn-manager/nm-vpn-connection.c:274
Work around that for now and live with the warnings until
we decide what to actually do about to_string_link().
Commit 240c92ddb5 added an assert
to check that the input netmask is valid. Revert that commit for
the most part, some changes to the test function are not reverted.
We don't want to assert for a valid netmask, because it's
common to read the netmask from (untrusted) user input, so we
don't want to assert against it.
The caller *could* validate the netmask from untrusted sources, but
with the assert in place it cannot validate it in the most obvious way:
prefix = nm_utils_ip4_netmask_to_prefix (netmask);
if (netmask != nm_utils_ip4_prefix_to_netmask (prefix))
goto fail;
Signed-off-by: Thomas Haller <thaller@redhat.com>
Devices disconnected explicitly by user should stay disconnected, preventing
auto-connecting until manual request.
Introduction of NM_DEVICE_STATE_DEACTIVATING state broke this feature.
disconnect_cb() correctly set autoconnect device property to FALSE, however
nm_device_state_changed() put it to TRUE again. Thus only the active connection
was blocked instead of the whole device.
https://bugzilla.gnome.org/show_bug.cgi?id=726239
When we kill a client, we usually get a DHCP event afterwards that cannot
be associated with the client anymore (because we forgot about its PID).
Do not log a warning in that case, but only a debug message.
Signed-off-by: Thomas Haller <thaller@redhat.com>
When an interface gets renamed, we first receive a libnl update with
the changed interface name.
This results in the following chain of calls:
- event_notification()
- announce_object()
- link_init()
- link_extract_type()
- link_type_from_udev()
Then link_type_from_udev() looks up the name in the udev data (getting
the previous name, because we did not yet recieve the udev notification)
and passes the name to wifi_utils_is_wifi(), which eventually calls
nm_platform_link_get_ifindex() -- doing a lookup by the old name.
Fix this, by passing the ifname from libnl to link_type_from_udev().
Also, change hack_empty_master_iff_lower_up() because it is called
from event_notification(), at a moment when the link cache possibly
does not yet know the ifindex -- so that the call chain to
link_extract_type(), link_type_from_udev(), wifi_utils_is_wifi()
again might lead to lookup for something that does not yet exist.
Note, that in this case the name would not yet exist, because we
did not yet put the libnl object into the link cache.
Signed-off-by: Thomas Haller <thaller@redhat.com>
When the PendingActivation removal changes landed, it required all
connections to be in a device's AvailableConnections property. Of
course since hidden networks don't broadcast the SSID, there's no
way to match them up with connections and put them into the
AvailableConnections property, so this was just plain broken.
Because not all clients set the 'hidden' property in a connection for
hidden/non-SSID-broadcasting networks, they may not show up in
the device's available-connections property. After the
PendingActivation object removal, all activations require the
connection to be in available-connections, and thus hidden SSID
networks could not be activated.
Unfortunately check_connection_available() is used both during
activation and to populate the available-connections array, but we
only want to special-case activation paths, and still ensure that
SSIDs not found in the scan list are not in available-connections.
To make it clear this is a WiFi only hack, and that we should
remove it at some point in the future, create another class method
specifically for hidden WiFi and use that in activation paths to
special-case hidden WiFi connection activation.
If an AP object is not given, and no compatible AP can be found
in the scan list, the AP is most likely not broadcasting its SSID
and should be marked as 'hidden'.
Replace '\r' and '\n' chareacter with a space in the configuration.
libteamdctl sends the config to team daemon using its usock interface that
separates parameters with '\n'.
Related: rh #1051517
The config is owned by teamd and will be freed by teamdctl_free(). Also use
teamdctl_config_get_raw_direct() instead of teamdctl_config_get_raw() to be
sure we have current data.
nmcli con add type team-slave ifname em2 master team-master0
nmcli con add type team-slave ifname em2 master id/team-master0
It helps to disambiguate values for cases where they may overlap,
e.g. "team0" -> "ifname/team0" or "id/team0"
nmcli con add type *-slave ifname em1 master <ifname|UUID|name>
'master' property of 'connection' setting has to be either interface name or
connection UUID of master connection. However, to make nmcli more convenient
for users, we also allow specifying connection name and translating it to UUID
automatically.
https://bugzilla.redhat.com/show_bug.cgi?id=1057494
Notes and changes by jklimes:
- fix reading TeamPort without TYPE=Ethernet
- fix tests
Ideally this should be solved on initscripts side. But teamd doesn't want to do
any changes to initscripts, so we make a workaround here.
https://bugzilla.redhat.com/show_bug.cgi?id=1074160
When an existing connection profile has IPv6 method 'ignore', NM doesn't simply
care about IPv6. Thus we should allow matching such a profile to devices with
just a link-local address.
The example can be a simple configuration like this:
/etc/sysconfig/network-scripts/ifcfg-ens3:
DEVICE="ens3"
ONBOOT=yes
NETBOOT=yes
UUID="aa17d688-a38d-481d-888d-6d69cca781b8"
BOOTPROTO=dhcp
HWADDR="52:54:00:32:77:59"
TYPE=Ethernet
NAME="ens3"
https://bugzilla.redhat.com/show_bug.cgi?id=1073824
Instead of only passing the ifindex to the callback, pack
additional data. This allows for better logging by also
writing the g_idle_add id which allows to associate the scheduling
with cancel calls.
Also, this fixes that the callback could not clear the
@delete_on_deactivate_id of the device, so that a following
delete_on_deactivate_unschedule() would think that there is
still something to cancel.
Signed-off-by: Thomas Haller <thaller@redhat.com>