]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-icmp.c
Fix small misspellings
[tcpdump] / print-icmp.c
index a5b94d63031309ffd4b05dbba8502b5a81b6fe6d..86da44bd99ec2bde3c99c9fec3812db6585ce258 100644 (file)
@@ -260,7 +260,7 @@ struct id_rdiscovery {
  * draft-bonica-internet-icmp-08
  *
  * The Destination Unreachable, Time Exceeded
- * and Parameter Problem messages are slighly changed as per
+ * and Parameter Problem messages are slightly changed as per
  * the above draft. A new Length field gets added to give
  * the caller an idea about the length of the piggypacked
  * IP packet before the MPLS extension header starts.
@@ -347,6 +347,7 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *
        char buf[MAXHOSTNAMELEN + 100];
        struct cksum_vec vec[1];
 
+       ndo->ndo_protocol = "icmp";
        dp = (const struct icmp *)bp;
         ext_dp = (const struct icmp_ext_t *)bp;
        ip = (const struct ip *)bp2;
@@ -591,6 +592,9 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *
                 ndo->ndo_snapend = snapend_save;
        }
 
+       /* ndo_protocol reassignment after ip_print() call */
+       ndo->ndo_protocol = "icmp";
+
         /*
          * Attempt to decode the MPLS extensions only for some ICMP types.
          */
@@ -696,11 +700,5 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *
 
        return;
 trunc:
-       ND_PRINT("[|icmp]");
+       nd_print_trunc(ndo);
 }
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 8
- * End:
- */