]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
Don't dissect a header with a version field != 4.
[tcpdump] / print-ip.c
index f178fef359df5e598c3e0fe8cc82ce95e4af77ef..71c7559b25f98f1c1e6ad78054b9765807825072 100644 (file)
@@ -529,9 +529,10 @@ ip_print(netdissect_options *ndo,
        ipds->ip = (const struct ip *)bp;
        ND_TCHECK(ipds->ip->ip_vhl);
        if (IP_V(ipds->ip) != 4) { /* print version if != 4 */
-           ND_PRINT((ndo, "IP%u ", IP_V(ipds->ip)));
+           ND_PRINT((ndo, "IP%u", IP_V(ipds->ip)));
            if (IP_V(ipds->ip) == 6)
              ND_PRINT((ndo, ", wrong link-layer encapsulation"));
+           return;
        }
        else if (!ndo->ndo_eflag)
                ND_PRINT((ndo, "IP "));