]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: Clean up HLP resize check
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 7 Feb 2017 18:50:33 +0000 (20:50 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Feb 2017 18:50:33 +0000 (20:50 +0200)
The "!wpabuf_resize(...) == 0" condition does not make any sense. It
happens to work, but this is really supposed to simple check with
wpabuf_resize() returns non-zero and "wpabuf_resize(...)" is the
cleanest way of doing so.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/fils_hlp.c

index c66c1f15ff9efe6315081cc5ee06ac9e5605bc5e..40d9be145e3ab8a9e8d3926cab78294fbe75eafc 100644 (file)
@@ -281,8 +281,8 @@ static void fils_dhcp_handler(int sd, void *eloop_ctx, void *sock_ctx)
        } else {
                wpabuf_put_data(resp, pos, end - pos);
        }
-       if (!wpabuf_resize(&sta->fils_hlp_resp, wpabuf_len(resp) +
-                          2 * wpabuf_len(resp) / 255 + 100) == 0) {
+       if (wpabuf_resize(&sta->fils_hlp_resp, wpabuf_len(resp) +
+                         2 * wpabuf_len(resp) / 255 + 100)) {
                wpabuf_free(resp);
                return;
        }