]> The Tcpdump Group git mirrors - tcpdump/commitdiff
The third argument to linkaddr_string is one of the LINKADDR_ enums.
authorGuy Harris <[email protected]>
Wed, 25 Dec 2019 01:47:23 +0000 (17:47 -0800)
committerGuy Harris <[email protected]>
Wed, 25 Dec 2019 01:47:23 +0000 (17:47 -0800)
It's *not* just a number like 0.  That *happens* to work, because, even
though LINKADDR_ETHER is currently 0, linkaddr_string() handles link
addresses of type LINKADDR_ETHER with a length other than 6 octets as
just a collection of octets, but we shouldn't *rely* on that.

print-ahcp.c
print-geonet.c

index 7a784bc2a70beabe6730fcc289240794c8e85c2b..63a1c86474fe45eaad0ee14ae1db3742dc9528b4 100644 (file)
@@ -388,11 +388,11 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
                                cp += 4;
                                /* Source Id */
                                ND_TCHECK_8(cp);
-                               ND_PRINT(", Source Id %s", linkaddr_string(ndo, cp, 0, 8));
+                               ND_PRINT(", Source Id %s", linkaddr_string(ndo, cp, LINKADDR_OTHER, 8));
                                cp += 8;
                                /* Destination Id */
                                ND_TCHECK_8(cp);
-                               ND_PRINT(", Destination Id %s", linkaddr_string(ndo, cp, 0, 8));
+                               ND_PRINT(", Destination Id %s", linkaddr_string(ndo, cp, LINKADDR_OTHER, 8));
                                cp += 8;
                        }
                        /* Body */
index 7ede5f3e49c0c4fabcafa09043d84120aeb74f53..67945800fa2a8daf81b6ca28db3c11512f177627 100644 (file)
@@ -89,7 +89,7 @@ print_long_pos_vector(netdissect_options *ndo,
        uint32_t lat, lon;
 
        ND_TCHECK_LEN(bp, GEONET_ADDR_LEN);
-       ND_PRINT("GN_ADDR:%s ", linkaddr_string (ndo, bp, 0, GEONET_ADDR_LEN));
+       ND_PRINT("GN_ADDR:%s ", linkaddr_string (ndo, bp, LINKADDR_OTHER, GEONET_ADDR_LEN));
 
        ND_TCHECK_8(bp + 12);
        lat = GET_BE_U_4(bp + 12);