]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
CONTRIBUTION: mention the nd_ types.
[tcpdump] / print-ip.c
index 4f9617a3c6a8b205225ffffda44131c5c3afef04..f90c58a041a8b1987724987d4134ec11141841e6 100644 (file)
@@ -363,8 +363,7 @@ ip_print(netdissect_options *ndo,
             if (len) {
                 ND_PRINT("bad-len %u", len);
                 return;
-            }
-            else {
+            } else {
                 /* we guess that it is a TSO send */
                 len = length;
             }
@@ -377,7 +376,10 @@ ip_print(netdissect_options *ndo,
        /*
         * Cut off the snapshot length to the end of the IP payload.
         */
-       nd_push_snaplen(ndo, bp, len);
+       if (!nd_push_snaplen(ndo, bp, len)) {
+               (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC,
+                       "%s: can't push snaplen on buffer stack", __func__);
+       }
 
        len -= hlen;