]> The Tcpdump Group git mirrors - tcpdump/commitdiff
tok2str-oobr-1: fixed issue where test reading a withdrawn routes of length 1 byte...
authorDavid Cronin <[email protected]>
Sun, 12 Nov 2017 13:01:56 +0000 (13:01 +0000)
committerDavid Cronin <[email protected]>
Sun, 12 Nov 2017 13:01:56 +0000 (13:01 +0000)
bgp_mvpn_6_and_7 && bgp_pmsi_tunnel-oobr && bgp_vpn_rt-oobr: All contained illegal prefix lengths in the withdrawn routes section, ie > than 32 for ipv4, so I modified the .pcap files to have legal prefixs so that the BGP wasn't truncated and updated the withdrawn routes in the test.out

print-bgp.c
tests/bgp_mvpn_6_and_7.out
tests/bgp_mvpn_6_and_7.pcap
tests/bgp_pmsi_tunnel-oobr.out
tests/bgp_pmsi_tunnel-oobr.pcap
tests/bgp_vpn_rt-oobr.out
tests/bgp_vpn_rt-oobr.pcap
tests/tok2str-oobr-1.out

index a632bc235ebae19c32c24a00ab0d932f79144cda..fe83922ddb8b178463854838637931ee9aeaba89 100644 (file)
@@ -2610,12 +2610,10 @@ bgp_update_print(netdissect_options *ndo,
        withdrawn_routes_len = EXTRACT_16BITS(p);
        p += 2;
        length -= 2;
-       if (withdrawn_routes_len) {
+       if (withdrawn_routes_len > 1) {
                ND_TCHECK2(p[0], withdrawn_routes_len);
                if (length < withdrawn_routes_len)
                        goto trunc;
-                if (withdrawn_routes_len < 2)
-                        goto trunc;
 
                 ND_PRINT((ndo, "\n\t  Withdrawn routes:"));
                 add_path = check_add_path(p, withdrawn_routes_len, 32);
@@ -2644,7 +2642,10 @@ bgp_update_print(netdissect_options *ndo,
                                 withdrawn_routes_len -= wpfx;
                         }
                 }
-       }
+       } else {
+                p += withdrawn_routes_len;
+                length -= withdrawn_routes_len;
+        }
 
        ND_TCHECK2(p[0], 2);
        if (length < 2)
index 3eb4a2d09cd9b03384d995bcaf3f0a84aa27fba0..636437be6d132701dddc75ffe7ce51ddda956eed 100644 (file)
@@ -1,7 +1,8 @@
 IP (tos 0xc, ttl 254, id 21263, offset 0, flags [rsvd], proto TCP (6), length 517, bad cksum 8e15 (->99c9)!)
     241.0.93.20.179 > 255.247.0.1.200: Flags [none], seq 2146691977:2146692450, win 56026, options [unknown-161,eol], length 473: BGP
        Update Message (2), length: 45
-         Withdrawn routes: 3 bytes
+         Withdrawn routes:
+           255.123.0.0/16
          Attribute Set (128), length: 7, Flags [OTPE+f]: 
            Origin AS: 148
              Multi-Protocol Reach NLRI (14), length: 71, Flags [T+6]: 
index a478b95d3d8091cb9dc422b605677eb9b5fa851a..1c73e10586e33568b65b73e847e6c2190277a6c0 100644 (file)
Binary files a/tests/bgp_mvpn_6_and_7.pcap and b/tests/bgp_mvpn_6_and_7.pcap differ
index 3b73c7a64527196d38f941d3fae62b95308fe53f..3951306ede3e12d7306b8c886d63843ca4bdc9d7 100644 (file)
@@ -1,7 +1,8 @@
 IP (tos 0x0, ttl 254, id 40207, offset 0, flags [+, DF, rsvd], proto TCP (6), length 296, bad cksum 8e15 (->3eaa)!)
     241.0.32.19.179 > 239.0.0.1.0: Flags [none], seq 2146695561:2146695813, win 56026, options [unknown-161,eol], length 252: BGP
        Update Message (2), length: 45
-         Withdrawn routes: 3 bytes
+         Withdrawn routes:
+           24.13.0.0/16
          Attribute Set (128), length: 7, Flags [OTPE+f]: 
            Origin AS: 4067
              Origin (1), length: 1EGP
index 33cf660ce01808405e27a12974e51d8be673ed0d..c3d5a9ebb3932365bc46912a8bece1a6e2f99f7b 100644 (file)
Binary files a/tests/bgp_pmsi_tunnel-oobr.pcap and b/tests/bgp_pmsi_tunnel-oobr.pcap differ
index b4159626794e90e6090b6ff6bf372a77302f7879..777ceece290260d50fab8bf6613f1ac437199b57 100644 (file)
@@ -1,7 +1,8 @@
 IP (tos 0xc, ttl 254, id 21263, offset 0, flags [rsvd], proto TCP (6), length 60165, bad cksum 8e15 (->9eb8)!)
     241.0.128.19.179 > 239.8.0.1.0: Flags [none], seq 2146695561:2146755682, win 56026, options [unknown-161,eol], length 60121: BGP
        Update Message (2), length: 45
-         Withdrawn routes: 3 bytes
+         Withdrawn routes:
+           255.144.0.0/12
          Attribute Set (128), length: 7, Flags [OTPE+f]: 
            Origin AS: 0
              Multi-Protocol Unreach NLRI (15), length: 227, Flags [T+6]: 
@@ -13,7 +14,8 @@ IP (tos 0xc, ttl 254, id 21263, offset 0, flags [rsvd], proto TCP (6), length 60
              Route-Type: Unknown (0), length: 0[|BGP] [|BGP]
        Update Message (2), length: 45[|BGP] [|BGP]
        Update Message (2), length: 45
-         Withdrawn routes: 3 bytes
+         Withdrawn routes:
+           255.112.0.0/12
          Attribute Set (128), length: 7, Flags [OTPE+f]: 
            Origin AS: 0
              Multi-Protocol Reach NLRI (14), length: 227, Flags [T+6]: 
index 69d5b960664ec2be34c4e2e857ac4ad44a5c7b12..83bca9bd5cbb92127582ef4eac9b6edffabf75ba 100644 (file)
Binary files a/tests/bgp_vpn_rt-oobr.pcap and b/tests/bgp_vpn_rt-oobr.pcap differ
index 7592f8e1a7db502919924eddf1ed6117cd56ee5b..f9a9bb3dd9d81eb1500fd84076c0b234a7b16da3 100644 (file)
@@ -55,7 +55,6 @@
              End-of-Rib Marker (empty NLRI)
            0x0000:  0001 80
        Update Message (2), length: 30
-         Withdrawn routes: 1 bytes
          Unknown Attribute (0), length: 3, Flags [+f]: 
            no Attribute 0 decoder
            0x0000:  0001 05[|BGP]