eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 122ea7a8aaac81dd29b76e3660f44f9ff2edc9ea
parent 5f7b28d501f42e52aa90e1940db8267b8cb820cb
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date:   Sat, 11 Jul 2020 03:00:36 +0200

p2p: Stop discovery after GO Negotiation Req error

If we were in discovery only to be able to receive the target peer's
GO Negotiation Request (i.e. we have no users requesting discovery)
and we've received the frame and decided that the connection has
failed, exit discovery.

Diffstat:
Msrc/p2p.c | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/p2p.c b/src/p2p.c @@ -1403,6 +1403,10 @@ static void p2p_device_go_negotiation_req_cb(const struct mmpdu_header *mpdu, l_error("GO Negotiation Request parse error %s (%i)", strerror(-r), -r); p2p_connect_failed(dev); + + if (l_queue_isempty(dev->discovery_users)) + p2p_device_discovery_stop(dev); + status = P2P_STATUS_FAIL_INVALID_PARAMS; goto respond; } @@ -1420,6 +1424,10 @@ static void p2p_device_go_negotiation_req_cb(const struct mmpdu_header *mpdu, } p2p_connect_failed(dev); + + if (l_queue_isempty(dev->discovery_users)) + p2p_device_discovery_stop(dev); + status = P2P_STATUS_FAIL_INCOMPATIBLE_PARAMS; goto p2p_free; } @@ -1435,6 +1443,10 @@ static void p2p_device_go_negotiation_req_cb(const struct mmpdu_header *mpdu, p2p_connect_failed(dev); l_error("Persistent groups not supported"); + + if (l_queue_isempty(dev->discovery_users)) + p2p_device_discovery_stop(dev); + status = P2P_STATUS_FAIL_INCOMPATIBLE_PARAMS; goto p2p_free; } @@ -1442,6 +1454,10 @@ static void p2p_device_go_negotiation_req_cb(const struct mmpdu_header *mpdu, if (req_info.device_password_id != dev->conn_password_id) { p2p_connect_failed(dev); l_error("Incompatible Password ID in the GO Negotiation Req"); + + if (l_queue_isempty(dev->discovery_users)) + p2p_device_discovery_stop(dev); + status = P2P_STATUS_FAIL_INCOMPATIBLE_PROVISIONING; goto p2p_free; }