diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-09-05 21:56:50 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-09-08 14:14:13 +0200 |
commit | aad6ac30ce7904f688226dbc61021ca4f907274f (patch) | |
tree | 76ffb3367a34d7e5225fa1bc0a75aa6406118b6d /print-ospf.c | |
parent | cbe18055349fa44ac8348c56834c32586e0a81ab (diff) | |
download | tcpdump-aad6ac30ce7904f688226dbc61021ca4f907274f.tar.gz |
Remove some now redundant ND_TCHECK_4() calls
ND_TCHECK_4(e).
They are redundant because they are followed by a GET_IPADDR_STRING(e)
call, same e, which do the bounds check.
Remove unused 'trunc' labels and associated codes.
Update the output of a test accordingly.
Diffstat (limited to 'print-ospf.c')
-rw-r--r-- | print-ospf.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/print-ospf.c b/print-ospf.c index a0474a39..09876377 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -491,7 +491,6 @@ ospf_te_lsa_print(netdissect_options *ndo, ND_PRINT("\n\t TLV length %u < 4", tlv_length); return -1; } - ND_TCHECK_4(tptr); ND_PRINT(", %s", GET_IPADDR_STRING(tptr)); break; @@ -698,7 +697,6 @@ ospf_print_lsa(netdissect_options *ndo, break; case LS_TYPE_NETWORK: - ND_TCHECK_4(lsap->lsa_un.un_nla.nla_mask); ND_PRINT("\n\t Mask %s\n\t Connected Routers:", GET_IPADDR_STRING(lsap->lsa_un.un_nla.nla_mask)); ap = lsap->lsa_un.un_nla.nla_router; @@ -766,11 +764,9 @@ ospf_print_lsa(netdissect_options *ndo, else ND_PRINT(" %u", (ul & ASLA_MASK_METRIC)); - ND_TCHECK_4(almp->asla_forward); if (GET_IPV4_TO_NETWORK_ORDER(almp->asla_forward) != 0) { ND_PRINT(", forward %s", GET_IPADDR_STRING(almp->asla_forward)); } - ND_TCHECK_4(almp->asla_tag); if (GET_IPV4_TO_NETWORK_ORDER(almp->asla_tag) != 0) { ND_PRINT(", tag %s", GET_IPADDR_STRING(almp->asla_tag)); } @@ -782,7 +778,6 @@ ospf_print_lsa(netdissect_options *ndo, /* Multicast extensions as of 23 July 1991 */ mcp = lsap->lsa_un.un_mcla; while ((const u_char *)mcp < ls_end) { - ND_TCHECK_4(mcp->mcla_vid); switch (GET_BE_U_4(mcp->mcla_vtype)) { case MCLA_VERTEX_ROUTER: @@ -999,12 +994,10 @@ ospf_decode_v2(netdissect_options *ndo, GET_IPADDR_STRING(op->ospf_hello.hello_mask), GET_U_1(op->ospf_hello.hello_priority)); - ND_TCHECK_4(op->ospf_hello.hello_dr); if (GET_IPV4_TO_NETWORK_ORDER(op->ospf_hello.hello_dr) != 0) ND_PRINT("\n\t Designated Router %s", GET_IPADDR_STRING(op->ospf_hello.hello_dr)); - ND_TCHECK_4(op->ospf_hello.hello_bdr); if (GET_IPV4_TO_NETWORK_ORDER(op->ospf_hello.hello_bdr) != 0) ND_PRINT(", Backup Designated Router %s", GET_IPADDR_STRING(op->ospf_hello.hello_bdr)); @@ -1134,10 +1127,8 @@ ospf_print(netdissect_options *ndo, dataend = bp + length; } - ND_TCHECK_4(op->ospf_routerid); ND_PRINT("\n\tRouter-ID %s", GET_IPADDR_STRING(op->ospf_routerid)); - ND_TCHECK_4(op->ospf_areaid); if (GET_IPV4_TO_NETWORK_ORDER(op->ospf_areaid) != 0) ND_PRINT(", Area %s", GET_IPADDR_STRING(op->ospf_areaid)); else |