mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 10:18:21 -05:00
Optimize Extended Capabilities element to be of minimal length
Leave out zero octets from the end of the element. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
8cd6b7bce8
commit
3db5439a5f
@ -239,7 +239,14 @@ u8 * hostapd_eid_ext_capab(struct hostapd_data *hapd, u8 *eid)
|
||||
}
|
||||
}
|
||||
|
||||
return pos;
|
||||
while (len > 0 && eid[1 + len] == 0) {
|
||||
len--;
|
||||
eid[1] = len;
|
||||
}
|
||||
if (len == 0)
|
||||
return eid;
|
||||
|
||||
return eid + 2 + len;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1231,7 +1231,14 @@ int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf)
|
||||
}
|
||||
}
|
||||
|
||||
return pos - buf;
|
||||
while (len > 0 && buf[1 + len] == 0) {
|
||||
len--;
|
||||
buf[1] = len;
|
||||
}
|
||||
if (len == 0)
|
||||
return 0;
|
||||
|
||||
return 2 + len;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user