Wireshark-commits: [Wireshark-commits] master 24712ec: Kafka: fix the FETCH response alignment issu
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 12 Jun 2020 06:01:46 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=24712ec0733ffba581f44a333349dd21bc4427a7
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

24712ec by Piotr Smolinski (piotr.smolinski@xxxxxxxxxxxx):

    Kafka: fix the FETCH response alignment issue
    
    There was a problem in FETCH response parsing when the server had more data than the requested
    maximal return size. In such case the server checks if the first chunk of data fits into buffer. If it does not,
    the first chunk is returned as a whole to the requestor. Otherwise it is assumed that the client is capable
    of discarding invalid content and the server pushes maximum available block. It makes sense, because
    the default block is 10MB and pushing it opaque leverages zero-copy IO from the file system to the network.
    
    In the existing implementation it was assumed that the last batch is aligned with the end of the buffer.
    Actually, if there is some data more, the last part is delivered truncated.
    
    This patch:
    * fixes the last part alignment handling
    * adds opaque field for truncated content
    * moves preferred replica field to the proper context
    
    Bug: 16623
    Change-Id: Iee6d513ce6711091e5561646a3fd563501eabdda
    Reviewed-on: https://code.wireshark.org/review/37446
    Petri-Dish: Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  c97076b   MAC LTE: add support for extended LCID
     add  24712ec   Kafka: fix the FETCH response alignment issue


Summary of changes:
 epan/dissectors/packet-kafka.c | 48 ++++++++++++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 13 deletions(-)