]> The Tcpdump Group git mirrors - tcpdump/commitdiff
bgp: Decode BGP link-bandwidth extended community properly
authorDonatas Abraitis <[email protected]>
Wed, 22 Sep 2021 08:30:06 +0000 (11:30 +0300)
committerDenis Ovsienko <[email protected]>
Sat, 9 Oct 2021 16:19:58 +0000 (17:19 +0100)
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 <[email protected]>
print-bgp.c

index 269055f568acb8ca0b6123fc665740088e56dffc..4404b026d29a484ba361b1d335b9c78306b84e30 100644 (file)
@@ -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;