]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Directly refer to ether_shost and ether_dhost; get rid of ESRC() and EDST().
authorGuy Harris <[email protected]>
Sun, 17 Dec 2017 03:57:14 +0000 (19:57 -0800)
committerGuy Harris <[email protected]>
Sun, 17 Dec 2017 03:57:14 +0000 (19:57 -0800)
They don't really add anything.

netdissect.h
print-ether.c

index 212ee15b6a36baeb9c1b05ddc711f6e09304fb86..a3d867350f2c0b8f6028d47c41fa8bab22e8647a 100644 (file)
@@ -283,9 +283,6 @@ struct netdissect_options {
  */
 #define MAXIMUM_SNAPLEN        262144
 
-#define ESRC(ep) ((ep)->ether_shost)
-#define EDST(ep) ((ep)->ether_dhost)
-
 /*
  * True if "l" bytes of "var" were captured.
  *
index ce96e62ec214a3df9d9b56763467ca67e4c5f062..7143830f92a742e8bc90eb48e18f08e388a98ef8 100644 (file)
@@ -114,8 +114,8 @@ ether_hdr_print(netdissect_options *ndo,
        ep = (const struct ether_header *)bp;
 
        ND_PRINT((ndo, "%s > %s",
-                    etheraddr_string(ndo, ESRC(ep)),
-                    etheraddr_string(ndo, EDST(ep))));
+                    etheraddr_string(ndo, ep->ether_shost),
+                    etheraddr_string(ndo, ep->ether_dhost)));
 
        length_type = EXTRACT_BE_U_2(ep->ether_length_type);
        if (!ndo->ndo_qflag) {
@@ -179,9 +179,9 @@ ether_print(netdissect_options *ndo,
        p += ETHER_HDRLEN;
        hdrlen = ETHER_HDRLEN;
 
-       src.addr = ESRC(ep);
+       src.addr = ep->ether_shost;
        src.addr_string = etheraddr_string;
-       dst.addr = EDST(ep);
+       dst.addr = ep->ether_dhost;
        dst.addr_string = etheraddr_string;
        length_type = EXTRACT_BE_U_2(ep->ether_length_type);