]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Properly handle the return value of macsec_print().
authorGuy Harris <[email protected]>
Thu, 28 May 2020 04:47:55 +0000 (21:47 -0700)
committerGitHub <[email protected]>
Thu, 28 May 2020 04:47:55 +0000 (21:47 -0700)
print-ether.c

index c7ee8687a5f7316a6716a166e18c9a4d493cd030..d20047da1ac6127d60b07c72d93a40a8c3adc05f 100644 (file)
@@ -211,10 +211,13 @@ recurse:
                 */
                int ret = macsec_print(ndo, &p, &length, &caplen, &hdrlen, &length_type);
 
-               if (ret == 0)
-                       goto raw;
-               else if (ret > 0)
-                       return ret;
+               if (ret == 0) {
+                       /* Payload is encrypted; just quit. */
+                       return (hdrlen + caplen);
+               } else if (ret > 0) {
+                       /* Problem printing the header; just quit. */
+                       return (ret);
+               }
        }
 
        /*