Wireshark-commits: [Wireshark-commits] master 099d241: dot11decrypt: Avoid allocating SA on packet

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 25 May 2020 14:52:07 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=099d241046e7e81268ee4979e129c8c19cd6c137
Submitter: "Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

099d241 by Mikael Kanstrup (mikael.kanstrup@xxxxxxxx):

    dot11decrypt: Avoid allocating SA on packet decryption
    
    The function used to search for an SA allocates one entry if none
    exists. Searching for an SA is done in many places including on
    packet decryption. In practise this means for every encrypted packet
    with unique STA/BSSID an SA is allocated. This is a waste both from a
    memory and performance point of view but also a limitation as with
    the old static array SA storage decryption would fail when max
    number of SAs is reached. i.e. decryption would fail for captures
    with more than 256 unique STA/BSSids.
    
    Separate the searching for SA entries and allocation of new SAs to
    avoid allocating unnecessary SA entries.
    
    Change-Id: I7ddc9ac4bad5d69e273f97f8f8fb38d34b59a854
    Reviewed-on: https://code.wireshark.org/review/37308
    Petri-Dish: Anders Broman <a.broman58@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  62f25df   dot11decrypt: Use hash table to store SA entries
     add  099d241   dot11decrypt: Avoid allocating SA on packet decryption


Summary of changes:
 epan/crypt/dot11decrypt.c | 242 ++++++++++++++++++++++++----------------------
 1 file changed, 125 insertions(+), 117 deletions(-)