]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use more the nd_print_trunc() call
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 20 Aug 2018 14:20:27 +0000 (16:20 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 20 Aug 2018 14:37:08 +0000 (16:37 +0200)
Update the output of some tests accordingly.

print-icmp6.c
tests/icmp6_mobileprefix_asan.out
tests/icmp6_nodeinfo_oobr.out

index ce56999589600764c5ace843ca09091793269c2b..85a919d131e2c93e61cf06ab58f243760ba4fb3a 100644 (file)
@@ -840,7 +840,7 @@ rpl_printopts(netdissect_options *ndo, const uint8_t *opts, u_int length)
         }
         return;
 trunc:
-       ND_PRINT(" [|truncated]");
+       nd_print_trunc(ndo);
        return;
 }
 
@@ -869,7 +869,7 @@ rpl_dio_print(netdissect_options *ndo,
         }
        return;
 trunc:
-       ND_PRINT(" [|truncated]");
+       nd_print_trunc(ndo);
        return;
 }
 
@@ -911,7 +911,7 @@ rpl_dao_print(netdissect_options *ndo,
        return;
 
 trunc:
-       ND_PRINT(" [|truncated]");
+       nd_print_trunc(ndo);
        return;
 
 tooshort:
@@ -1013,7 +1013,7 @@ rpl_print(netdissect_options *ndo,
 
 #if 0
 trunc:
-       ND_PRINT(" [|truncated]");
+       nd_print_trunc(ndo);
        return;
 #endif
 
@@ -1328,7 +1328,7 @@ icmp6_print(netdissect_options *ndo,
                 ND_PRINT(", length %u", length);
        return;
 trunc:
-       ND_PRINT("[|icmp6]");
+       nd_print_trunc(ndo);
 }
 
 static const struct udphdr *
@@ -1626,7 +1626,7 @@ mldv2_report_print(netdissect_options *ndo, const u_char *bp, u_int len)
     }
     return;
 trunc:
-    ND_PRINT("[|icmp6]");
+    nd_print_trunc(ndo);
     return;
 }
 
@@ -1693,7 +1693,7 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len)
     ND_PRINT("]");
     return;
 trunc:
-    ND_PRINT("[|icmp6]");
+    nd_print_trunc(ndo);
     return;
 }
 
@@ -1862,10 +1862,8 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp,
                break;
 
        case ICMP6_NI_REPLY:
-               if (icmp6len > siz) {
-                       ND_PRINT("[|icmp6: node information reply]");
-                       break;
-               }
+               if (icmp6len > siz)
+                       goto trunc;
 
                needcomma = 0;
 
@@ -1980,7 +1978,7 @@ icmp6_nodeinfo_print(netdissect_options *ndo, u_int icmp6len, const u_char *bp,
        return;
 
 trunc:
-       ND_PRINT("[|icmp6]");
+       nd_print_trunc(ndo);
 }
 
 static void
@@ -2116,5 +2114,5 @@ icmp6_rrenum_print(netdissect_options *ndo, const u_char *bp, const u_char *ep)
        return;
 
 trunc:
-       ND_PRINT("[|icmp6]");
+       nd_print_trunc(ndo);
 }
index b96c3b4fdeebaa98a26396b21a112010ba4833af..c204cff9cee69b44603a80d3e890b254a1d2f065 100644 (file)
@@ -1,2 +1,2 @@
-    1  07:49:20.11534339 IP6 (class 0x50, flowlabel 0x0002c, hlim 0, next-header ICMPv6 (58) payload length: 7168) 4f:f829:c:1a1a:1a1a:1a1a:1a37:0 > 16:0:400:0:64fb:9303:f293:8200: ICMP6, mobile router advertisement, length 7168, id 0x9393[|icmp6]
+    1  07:49:20.11534339 IP6 (class 0x50, flowlabel 0x0002c, hlim 0, next-header ICMPv6 (58) payload length: 7168) 4f:f829:c:1a1a:1a1a:1a1a:1a37:0 > 16:0:400:0:64fb:9303:f293:8200: ICMP6, mobile router advertisement, length 7168, id 0x9393 [|icmp6]
     2  [Invalid header: caplen==0, len==0]
index e3a33f560dfa2f71655c8a661e76f11a7a3b2ab9..222a1a49a2a5c2690b56ead074068260097108b0 100644 (file)
@@ -1 +1 @@
-    1  03:32:08.002213 IP6 a072:7f00:1:7f00:1:e01a:17:6785 > c903::a002:8018:fe30:0:204: ICMP6, who-are-you reply[|icmp6], length 4
+    1  03:32:08.002213 IP6 a072:7f00:1:7f00:1:e01a:17:6785 > c903::a002:8018:fe30:0:204: ICMP6, who-are-you reply [|icmp6], length 4