]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print.c
Add printing support for vsockmon devices.
[tcpdump] / print.c
diff --git a/print.c b/print.c
index 1669cb3b4db680eeab7ae3a4fda9504b3ea1573b..44040ecd8550a645cbd784cfe27a405c014fee68 100644 (file)
--- a/print.c
+++ b/print.c
@@ -233,6 +233,9 @@ static const struct printer printers[] = {
 #endif
 #ifdef DLT_DSA_TAG_BRCM_PREPEND
        { brcm_tag_prepend_if_print, DLT_DSA_TAG_BRCM_PREPEND },
+#endif
+#ifdef DLT_VSOCK
+       { vsock_if_print,       DLT_VSOCK },
 #endif
        { NULL,                 0 },
 };
@@ -405,6 +408,13 @@ pretty_print_packet(netdissect_options *ndo, const struct pcap_pkthdr *h,
                ND_PRINT(" [|%s]", ndo->ndo_protocol);
        }
 
+       /*
+        * Free all pushed buffers; if we got here by a printer quitting,
+        * we need to release anything that didn't get released because
+        * we longjmped out of the code before it popped a buffer.
+        */
+       nd_pop_all_buffers(ndo);
+
        /*
         * Restore the original snapend, as a printer might have
         * changed it.