From: Donatas Abraitis Date: Wed, 22 Sep 2021 08:30:06 +0000 (+0300) Subject: bgp: Decode BGP link-bandwidth extended community properly X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/31c9c8736bf471385c41f532d96faf50a9ef62d1 bgp: Decode BGP link-bandwidth extended community properly First two bytes are reserved for AS. Before: ``` Extended Community (16), length: 8, Flags [OT]: link-BW (0x4004), Flags [non-transitive]: bandwidth: -308754489798474897524123005616128.000 Mbps 0x0000: 4004 fde8 47f4 2400 Updated routes: 192.168.10.0/23 ``` After: ``` Extended Community (16), length: 8, Flags [OT]: link-BW (0x4004), Flags [non-transitive]: bandwidth: 1.000 Mbps 0x0000: 4004 fde8 47f4 2400 Updated routes: 192.168.10.0/23 ``` Signed-off-by: Donatas Abraitis --- diff --git a/print-bgp.c b/print-bgp.c index 269055f5..4404b026 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -842,7 +842,7 @@ bgp_extended_community_print(netdissect_options *ndo, break; case BGP_EXT_COM_LINKBAND: - bw.i = GET_BE_U_4(pptr + 2); + bw.i = GET_BE_U_4(pptr + 4); ND_PRINT("bandwidth: %.3f Mbps", bw.f*8/1000000); break;