]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bootp.c
MPCP: Modernize packet parsing style.
[tcpdump] / print-bootp.c
index ce34d13dd0a173e0522e8362e0218e5307c82ac7..f84b77cad25dcabf0a3026dae193f943e8edde8d 100644 (file)
@@ -295,7 +295,7 @@ bootp_print(netdissect_options *ndo,
 
        bp_htype = GET_U_1(bp->bp_htype);
        bp_hlen = GET_U_1(bp->bp_hlen);
-       if (bp_htype == 1 && bp_hlen == 6 && bp_op == BOOTPREQUEST) {
+       if (bp_htype == 1 && bp_hlen == MAC_ADDR_LEN && bp_op == BOOTPREQUEST) {
                ND_PRINT(" from %s", GET_ETHERADDR_STRING(bp->bp_chaddr));
        }
 
@@ -311,7 +311,7 @@ bootp_print(netdissect_options *ndo,
                ND_PRINT(", htype %u", bp_htype);
 
        /* The usual length for 10Mb Ethernet address is 6 bytes */
-       if (bp_htype != 1 || bp_hlen != 6)
+       if (bp_htype != 1 || bp_hlen != MAC_ADDR_LEN)
                ND_PRINT(", hlen %u", bp_hlen);
 
        /* Only print interesting fields */
@@ -344,7 +344,7 @@ bootp_print(netdissect_options *ndo,
                ND_PRINT("\n\t  Gateway-IP %s", GET_IPADDR_STRING(bp->bp_giaddr));
 
        /* Client's Ethernet address */
-       if (bp_htype == 1 && bp_hlen == 6) {
+       if (bp_htype == 1 && bp_hlen == MAC_ADDR_LEN) {
                ND_PRINT("\n\t  Client-Ethernet-Address %s", GET_ETHERADDR_STRING(bp->bp_chaddr));
        }