]> The Tcpdump Group git mirrors - tcpdump/commitdiff
bgp: Shutdown message can be up to 255 bytes length according to rfc9003
authorDonatas Abraitis <[email protected]>
Wed, 2 Feb 2022 12:28:21 +0000 (14:28 +0200)
committerDenis Ovsienko <[email protected]>
Sat, 12 Feb 2022 16:37:37 +0000 (16:37 +0000)
Signed-off-by: Donatas Abraitis <[email protected]>
print-bgp.c
tests/TESTLIST
tests/bgp-extended-shutdown-msg.out [new file with mode: 0644]
tests/bgp-extended-shutdown-msg.pcap [new file with mode: 0644]

index b580646f75054cfbc11f4e1e831d46c249983dc8..f5c3dfad0aaad47b21e5e17a06b7415234616790 100644 (file)
@@ -278,7 +278,6 @@ static const struct tok bgp_notify_major_values[] = {
 /* draft-ietf-idr-shutdown-07 */
 #define BGP_NOTIFY_MINOR_CEASE_SHUT     2
 #define BGP_NOTIFY_MINOR_CEASE_RESET    4
-#define BGP_NOTIFY_MINOR_CEASE_ADMIN_SHUTDOWN_LEN   128
 static const struct tok bgp_notify_minor_cease_values[] = {
     { BGP_NOTIFY_MINOR_CEASE_MAXPRFX, "Maximum Number of Prefixes Reached"},
     { BGP_NOTIFY_MINOR_CEASE_SHUT,    "Administrative Shutdown"},
@@ -3017,8 +3016,7 @@ bgp_notification_print(netdissect_options *ndo,
             shutdown_comm_length = GET_U_1(tptr);
             remainder_offset = 0;
             /* garbage, hexdump it all */
-            if (shutdown_comm_length > BGP_NOTIFY_MINOR_CEASE_ADMIN_SHUTDOWN_LEN ||
-                shutdown_comm_length > length - (BGP_NOTIFICATION_SIZE + 1)) {
+            if (shutdown_comm_length > length - (BGP_NOTIFICATION_SIZE + 1)) {
                 ND_PRINT(", invalid Shutdown Communication length");
             }
             else if (shutdown_comm_length == 0) {
index 540f512296a951e064f1df0f8b823bd3cb2177a5..91fedcd469ed6b7577ef9b76a31ed3116291c758 100644 (file)
@@ -59,6 +59,7 @@ bgp-evpn      bgp-evpn.pcap           bgp-evpn.out            -v
 bgp-llgr       bgp-evpn.pcap           bgp-llgr.out            -v
 bgp-encap      bgp-encap.pcap          bgp-encap.out           -v
 bgp-rt-prefix  bgp-rt-prefix.pcap      bgp-rt-prefix.out       -v
+bgp-extended-shutdown-msg      bgp-extended-shutdown-msg.pcap  bgp-extended-shutdown-msg.out   -v
 bgp-link-bw-extcommunity       bgp-link-bw-extcommunity.pcapng bgp-link-bw-extcommunity.out    -v
 bgp-extended-msg       bgp-extended-msg.pcapng bgp-extended-msg.out    -v
 bgp-enhanced-route-refresh     bgp-enhanced-route-refresh.pcapng       bgp-enhanced-route-refresh.out  -v
diff --git a/tests/bgp-extended-shutdown-msg.out b/tests/bgp-extended-shutdown-msg.out
new file mode 100644 (file)
index 0000000..709a467
--- /dev/null
@@ -0,0 +1,3 @@
+    1  08:40:34.846110 IP (tos 0xc0, ttl 1, id 27458, offset 0, flags [DF], proto TCP (6), length 284)
+    192.168.10.123.36208 > 192.168.10.17.179: Flags [P.], cksum 0x415a (correct), seq 496762307:496762539, ack 691810051, win 502, options [nop,nop,TS val 822562185 ecr 4289027422], length 232: BGP
+       Notification Message (3), length: 232, Cease (6), subcode Administrative Shutdown (2), Shutdown Communication (length: 210): "[TICKET-1-1438367390] software upgrade; Expected downtime for 2 hours;[TICKET-1-1438367390] software upgrade; Expected downtime for 2 hours;[TICKET-1-1438367390] software upgrade; Expected downtime for 2 hours;"
diff --git a/tests/bgp-extended-shutdown-msg.pcap b/tests/bgp-extended-shutdown-msg.pcap
new file mode 100644 (file)
index 0000000..dff19cf
Binary files /dev/null and b/tests/bgp-extended-shutdown-msg.pcap differ