From: Denis Ovsienko Date: Sat, 19 Sep 2020 00:44:59 +0000 (+0100) Subject: Use MAC_ADDR_LEN in a few more places. [skip ci] X-Git-Tag: tcpdump-4.99-bp~216 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/4963b2e1386fb0edaf2c44d1bdd6431ad41872c2 Use MAC_ADDR_LEN in a few more places. [skip ci] --- diff --git a/print-cfm.c b/print-cfm.c index 52965a96..27e72a23 100644 --- a/print-cfm.c +++ b/print-cfm.c @@ -407,7 +407,7 @@ cfm_print(netdissect_options *ndo, break; case CFM_CCM_MD_FORMAT_MAC: - if (md_namelength == 6) { + if (md_namelength == MAC_ADDR_LEN) { ND_PRINT("\n\t MAC %s", GET_ETHERADDR_STRING(md_name)); } else { ND_PRINT("\n\t MAC (length invalid)"); diff --git a/print-isoclns.c b/print-isoclns.c index 44d1aa73..6762f4d9 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -1298,7 +1298,7 @@ esis_print(netdissect_options *ndo, pptr += netal; li -= netal; - if (snpal == 6) + if (snpal == MAC_ADDR_LEN) ND_PRINT("\n\t SNPA (length: %u): %s", snpal, GET_ETHERADDR_STRING(snpa)); diff --git a/print-sll.c b/print-sll.c index 38db4520..ad0ae7f1 100644 --- a/print-sll.c +++ b/print-sll.c @@ -162,7 +162,7 @@ sll_print(netdissect_options *ndo, const struct sll_header *sllp, u_int length) * For now, we just assume 6 means Ethernet. * XXX - print others as strings of hex? */ - if (GET_BE_U_2(sllp->sll_halen) == 6) + if (GET_BE_U_2(sllp->sll_halen) == MAC_ADDR_LEN) ND_PRINT("%s ", GET_ETHERADDR_STRING(sllp->sll_addr)); if (!ndo->ndo_qflag) { @@ -354,7 +354,7 @@ sll2_print(netdissect_options *ndo, const struct sll2_header *sllp, u_int length * For now, we just assume 6 means Ethernet. * XXX - print others as strings of hex? */ - if (GET_U_1(sllp->sll2_halen) == 6) + if (GET_U_1(sllp->sll2_halen) == MAC_ADDR_LEN) ND_PRINT("%s ", GET_ETHERADDR_STRING(sllp->sll2_addr)); if (!ndo->ndo_qflag) {