From 2042fe7a73c0fc77ff39edaa8f3a0fe0ab432234 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 19 Mar 2019 11:45:03 -0700 Subject: [PATCH] netdev: fix WPS test (with ControlPortOverNL80211 on) At some point the connect command builder was modified, and the control port over NL80211 check was moved to inside if (is_rsn). For WPS, no supplicant_ie was set, so CONTROL_PORT_OVER_NL80211 was never set into CMD_CONNECT. This caused IWD to expect WPS frames over netlink, but the kernel was sending them over the legacy route. --- src/netdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index c14509e9..2edf86a3 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -2745,16 +2745,16 @@ static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev, l_genl_msg_append_attr(msg, NL80211_ATTR_CONTROL_PORT, 0, NULL); - if (netdev->pae_over_nl80211) - l_genl_msg_append_attr(msg, - NL80211_ATTR_CONTROL_PORT_OVER_NL80211, - 0, NULL); - iov[iov_elems].iov_base = (void *) hs->supplicant_ie; iov[iov_elems].iov_len = hs->supplicant_ie[1] + 2; iov_elems += 1; } + if (netdev->pae_over_nl80211) + l_genl_msg_append_attr(msg, + NL80211_ATTR_CONTROL_PORT_OVER_NL80211, + 0, NULL); + if (hs->mde) { iov[iov_elems].iov_base = (void *) hs->mde; iov[iov_elems].iov_len = hs->mde[1] + 2;