Wireshark-commits: [Wireshark-commits] master f4ab3f4: ceph: distingush between client and server b
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 12 Jul 2016 06:03:00 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=f4ab3f492f5b2dfef55a65900ec256655c110e23
Submitter: Alexis La Goutte (alexis.lagoutte@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

f4ab3f4 by Jeff Layton (jlayton@xxxxxxxxxx):

    ceph: distingush between client and server by checking for a second entity_addr_t
    
    The current ceph dissector assumes that the server will always send its
    initial connection negotiation first, but that's not necessarily the
    case, especially with the kernel client which sends its banner as soon
    as the socket is created.
    
    So, we need a better mechanism to determine which end is client and
    which is the server. The server sends its own address and then the
    address of the client, but the client only sends its own address. We
    can determine whether the initial negotiation message is from the client
    or server by looking at the data after the first entity addr and seeing
    whether it also looks like an entity addr.
    
    This patch takes that approach. It just grabs the address family from
    the second address and sees whether it's IPv4 or IPv6. If it's not one
    of those, then it assumes that it's not an entity_addr_t at all and is
    therefore a request from the client.
    
    We could go farther and try to verify the port and address as well, but
    that's probably overkill. The address family is at the same offset as
    the host_type field in the client's Connect request, but it's big endian
    and the host_type is little endian. As long as we don't end up with
    host_types that are 0x200 or 0xA00, this scheme should be OK.
    
    Change-Id: I161d02da86d978272eff95497c6df66766b02ebc
    Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
    Reviewed-on: https://code.wireshark.org/review/16043
    Petri-Dish: Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    Reviewed-by: Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>
    

Actions performed:

    from  2e879e2   Generic Protocol Extension support for VxLAN
    adds  f4ab3f4   ceph: distingush between client and server by checking for a second entity_addr_t


Summary of changes:
 epan/dissectors/packet-ceph.c |   76 +++++++++++++++++++++++++++++------------
 1 file changed, 54 insertions(+), 22 deletions(-)