This adds -EBADMSG/-ENOMSG to be handled specially by allowing the frame to be dropped, similar to 0 or -EAGAIN. The difference though is that a non-zero authenticate status will result in the kernel not re-transmitting which ultimately could leave IWD in a connecting state with no way of leaving. Because of this we handle a non-zero status for these two returns as a failed connection. --- src/netdev.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) v3: * Only drop the message if the status was successful. diff --git a/src/netdev.c b/src/netdev.c index 7909c37e..fc4613e6 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -2717,7 +2717,17 @@ static void netdev_authenticate_event(struct l_genl_msg *msg, ret = auth_proto_rx_authenticate(netdev->ap, frame, frame_len); if (ret == 0 || ret == -EAGAIN) return; - else if (ret > 0) + else if (ret == -EBADMSG || ret == -ENOMSG) { + /* + * Only drop if the status is success. Otherwise + * dropping the message here would prevent the kernel + * from re-transmitting, leaving IWD in this connecting + * state. If this happens the only option is to fail the + * connection here. + */ + if (status_code == 0) + return; + } else if (ret > 0) status_code = (uint16_t)ret; } -- 2.31.1