diff options
author | Enzo Matsumiya <ematsumiya@suse.de> | 2023-06-10 00:29:59 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-06-12 04:52:49 +0300 |
commit | 50e63d6db6fd30a6dd9a33c49aa5b0bba36e1a92 (patch) | |
tree | b31d540518bf8a0fbbd05d7335fc24fe028239c4 /scripts/gdb/linux/utils.py | |
parent | 2a44b389664c193dc06cb37d9663d3c5a2a2b743 (diff) | |
download | linux-50e63d6db6fd30a6dd9a33c49aa5b0bba36e1a92.tar.xz |
smb/client: print "Unknown" instead of bogus link speed value
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: Enzo Matsumiya <ematsumiya@suse.de>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions