• Enzo Matsumiya's avatar
    smb/client: print "Unknown" instead of bogus link speed value · 50e63d6d
    Enzo Matsumiya authored
    The virtio driver for Linux guests will not set a link speed to its
    paravirtualized NICs.  This will be seen as -1 in the ethernet layer, and
    when some servers (e.g. samba) fetches it, it's converted to an unsigned
    value (and multiplied by 1000 * 1000), so in client side we end up with:
    
    1)      Speed: 4294967295000000 bps
    
    in DebugData.
    
    This patch introduces a helper that returns a speed string (in Mbps or
    Gbps) if interface speed is valid (>= SPEED_10 and <= SPEED_800000), or
    "Unknown" otherwise.
    
    The reason to not change the value in iface->speed is because we don't
    know the real speed of the HW backing the server NIC, so let's keep
    considering these as the fastest NICs available.
    
    Also print "Capabilities: None" when the interface doesn't support any.
    Signed-off-by: default avatarEnzo Matsumiya <ematsumiya@suse.de>
    Reviewed-by: default avatarShyam Prasad N <sprasad@microsoft.com>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    50e63d6d
cifs_debug.c 32.5 KB