1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 11:55:44 +03:00

wifi-util: do not ignore wifi iftype when SSID is not set

Previously, if an interface does not have SSID, e.g. run in mesh-point
type, then the wifi iftype obtained by the netlink call was ignored.

Fixes #18059.
This commit is contained in:
Yu Watanabe 2021-01-11 23:36:42 +09:00
parent a533007815
commit a66a402da4

View File

@ -29,8 +29,10 @@ int wifi_get_interface(sd_netlink *genl, int ifindex, enum nl80211_iftype *iftyp
}
if (r < 0)
return log_debug_errno(r, "Failed to request information about wifi interface %d: %m", ifindex);
if (!reply)
if (!reply) {
log_debug_errno(r, "No reply received to request for information about wifi interface %d, ignoring.", ifindex);
goto nodata;
}
r = sd_netlink_message_get_errno(reply);
if (r < 0)
@ -56,8 +58,8 @@ int wifi_get_interface(sd_netlink *genl, int ifindex, enum nl80211_iftype *iftyp
if (ssid) {
r = sd_netlink_message_read_string_strdup(reply, NL80211_ATTR_SSID, ssid);
if (r == -ENODATA)
goto nodata;
if (r < 0)
*ssid = NULL;
else if (r < 0)
return log_debug_errno(r, "Failed to get NL80211_ATTR_SSID attribute: %m");
}
@ -95,8 +97,10 @@ int wifi_get_station(sd_netlink *genl, int ifindex, struct ether_addr *bssid) {
r = sd_netlink_call(genl, m, 0, &reply);
if (r < 0)
return log_debug_errno(r, "Failed to request information about wifi station: %m");
if (!reply)
if (!reply) {
log_debug_errno(r, "No reply received to request for information about wifi station, ignoring.");
goto nodata;
}
r = sd_netlink_message_get_errno(reply);
if (r < 0)