]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-icmp6.c
bgp: Parse BGP extended message support capability
[tcpdump] / print-icmp6.c
index 8589730376f513ff3b85fa020887a14975ef2835..f16c1fa9d4aed85a098c9954f01ad80e75166659 100644 (file)
@@ -843,7 +843,6 @@ rpl_printopts(netdissect_options *ndo, const uint8_t *opts, u_int length)
         return;
 trunc:
        nd_print_trunc(ndo);
-       return;
 }
 
 static void
@@ -872,7 +871,6 @@ rpl_dio_print(netdissect_options *ndo,
        return;
 trunc:
        nd_print_trunc(ndo);
-       return;
 }
 
 static void
@@ -918,7 +916,6 @@ trunc:
 
 tooshort:
        ND_PRINT(" [|length too short]");
-       return;
 }
 
 static void
@@ -961,7 +958,6 @@ trunc:
 
 tooshort:
        ND_PRINT(" [|dao-length too short]");
-       return;
 }
 
 static void
@@ -1168,7 +1164,6 @@ icmp6_print(netdissect_options *ndo,
                break;
        case ICMP6_ECHO_REQUEST:
        case ICMP6_ECHO_REPLY:
-                /* The check below covers both icmp6_id and icmp6_seq. */
                 ND_PRINT(", id %u, seq %u", GET_BE_U_2(dp->icmp6_id),
                         GET_BE_U_2(dp->icmp6_seq));
                break;
@@ -1519,12 +1514,10 @@ icmp6_opt_print(netdissect_options *ndo, const u_char *bp, int resid)
                        case 1:
                                break;
                        case 2:
-                               ND_TCHECK_8(opri + 1);
-                               memcpy(&in6, opri + 1, 8);
+                               GET_CPY_BYTES(&in6, opri + 1, 8);
                                break;
                        case 3:
-                               ND_TCHECK_16(opri + 1);
-                               memcpy(&in6, opri + 1, 16);
+                               GET_CPY_BYTES(&in6, opri + 1, 16);
                                break;
                        default:
                                goto trunc;
@@ -1596,7 +1589,6 @@ mldv2_report_print(netdissect_options *ndo, const u_char *bp, u_int len)
                     ND_PRINT(" [invalid number of groups]");
                     return;
            }
-            ND_TCHECK_LEN(bp + 4 + group, sizeof(nd_ipv6));
             ND_PRINT(" [gaddr %s", GET_IP6ADDR_STRING(bp + group + 4));
            ND_PRINT(" %s", tok2str(mldv2report2str, " [v2-report-#%u]",
                                          GET_U_1(bp + group)));
@@ -1612,8 +1604,6 @@ mldv2_report_print(netdissect_options *ndo, const u_char *bp, u_int len)
                /* Print the sources */
                     ND_PRINT(" {");
                 for (j = 0; j < nsrcs; j++) {
-                    ND_TCHECK_LEN(bp + group + 20 + (j * sizeof(nd_ipv6)),
-                                  sizeof(nd_ipv6));
                    ND_PRINT(" %s", GET_IP6ADDR_STRING(bp + group + 20 + (j * sizeof(nd_ipv6))));
                }
                 ND_PRINT(" }");
@@ -1623,10 +1613,6 @@ mldv2_report_print(netdissect_options *ndo, const u_char *bp, u_int len)
            ND_PRINT("]");
         }
     }
-    return;
-trunc:
-    nd_print_trunc(ndo);
-    return;
 }
 
 static void
@@ -1652,11 +1638,9 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len)
     if (ndo->ndo_vflag) {
             ND_PRINT(" [max resp delay=%u]", mrt);
     }
-    ND_TCHECK_LEN(bp + 8, sizeof(nd_ipv6));
     ND_PRINT(" [gaddr %s", GET_IP6ADDR_STRING(bp + 8));
 
     if (ndo->ndo_vflag) {
-        ND_TCHECK_1(bp + 25);
        if (GET_U_1(bp + 24) & 0x08) {
                ND_PRINT(" sflag");
        }
@@ -1679,8 +1663,6 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len)
        else if (ndo->ndo_vflag > 1) {
            ND_PRINT(" {");
            for (i = 0; i < nsrcs; i++) {
-               ND_TCHECK_LEN(bp + 28 + (i * sizeof(nd_ipv6)),
-                              sizeof(nd_ipv6));
                ND_PRINT(" %s", GET_IP6ADDR_STRING(bp + 28 + (i * sizeof(nd_ipv6))));
            }
            ND_PRINT(" }");
@@ -1688,10 +1670,6 @@ mldv2_query_print(netdissect_options *ndo, const u_char *bp, u_int len)
                 ND_PRINT(", %u source(s)", nsrcs);
     }
     ND_PRINT("]");
-    return;
-trunc:
-    nd_print_trunc(ndo);
-    return;
 }
 
 static void