]> The Tcpdump Group git mirrors - tcpdump/commitdiff
PPP: Add tests to avoid incorrectly re-entering ppp_hdlc()
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 6 Jun 2022 14:36:57 +0000 (16:36 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 6 Jun 2022 15:15:26 +0000 (17:15 +0200)
print-ppp.c
tests/of10_inv_QUEUE_GET_CONFIG_REPLY-vv.out

index 76494410982e0798bfd4f924d41b49c5c5b42fea..8e63b4a1027e72ff50c0fd66f39adc67ef765bf2 100644 (file)
@@ -1428,10 +1428,16 @@ ppp_hdlc(netdissect_options *ndo,
             if (length < 4)
                 goto trunc;
             proto = GET_BE_U_2(b + 2); /* load the PPP proto-id */
-            handle_ppp(ndo, proto, b + 4, length - 4);
+            if ((proto & 0xff00) == 0x7e00)
+                ND_PRINT("(protocol 0x%04x invalid)", proto);
+            else
+                handle_ppp(ndo, proto, b + 4, length - 4);
             break;
         default: /* last guess - proto must be a PPP proto-id */
-            handle_ppp(ndo, proto, b + 2, length - 2);
+            if ((proto & 0xff00) == 0x7e00)
+                ND_PRINT("(protocol 0x%04x invalid)", proto);
+            else
+                handle_ppp(ndo, proto, b + 2, length - 2);
             break;
         }
 
index 60bc83e933ca2fab0527598f5953f6f1fd5f1daf..f9f4b6e22376d5d959926ba604841c8d9d6cdf00 100644 (file)
@@ -1,8 +1 @@
-    1  06:10:40.134396994 : IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 1540, bad cksum 11ce (->4fbd)!)
-    109.74.202.0.6653 > 4.184.169.52.4708: Flags [P.], cksum 0x8000 (incorrect -> 0x4d3b), seq 3422244149:3422245637, ack 774246557, win 0, options [nop,nop,unknown-16 0x112e355c0302fa3b], length 1488: OpenFlow
-       version 1.0, type QUEUE_GET_CONFIG_REPLY, length 278, xid 0xc7ffffff
-        port 64773
-         queue_id 0, len 255
-          property NONE, len 0 [property length 0 < 8] (invalid)
-         [remaining length 7 < 8] (invalid)
-       version unknown (0x12), type unknown (0x12), length 4626, xid 0x12121212 [|openflow]
+    1  06:10:40.134396994 : (protocol 0x7e7e invalid)