diff options
author | João Valverde <j@v6e.pt> | 2023-10-29 10:41:00 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-10-29 15:17:31 +0000 |
commit | ca392f6ddce64081c39538592d18dcf474ffdf59 (patch) | |
tree | ec805b1e03ae16725f194c80f84feeac3e4c927f /epan/addr_resolv.c | |
parent | 1c2cf8064a2888465cd65c15e3deacb9d2107547 (diff) |
wsutil/to_str: Deprecate ip_to_str() for endian-explicit versions
ip_to_str() forces the caller to cast the argument and it's not
obvious at all that the input should be in network-byte order
for IPv4 addresses.
Deprecated the function and add endian-explicit substitutes (number
vs address).
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r-- | epan/addr_resolv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index 058be082c3..e70e9999a5 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -1052,7 +1052,7 @@ fill_dummy_ip4(const guint addr, hashipv4_t* volatile tp) gsize i; host_addr = addr & (~subnet_entry.mask); - ip_to_str_buf((guint8 *)&host_addr, buffer, WS_INET_ADDRSTRLEN); + ip_addr_to_str_buf(&host_addr, buffer, WS_INET_ADDRSTRLEN); paddr = buffer; /* Skip to first octet that is not totally masked @@ -1073,7 +1073,7 @@ fill_dummy_ip4(const guint addr, hashipv4_t* volatile tp) snprintf(tp->name, MAXNAMELEN, "%s%s", subnet_entry.name, paddr); } else { /* XXX: This means we end up printing "1.2.3.4 (1.2.3.4)" in many cases */ - ip_to_str_buf((const guint8 *)&addr, tp->name, MAXNAMELEN); + ip_addr_to_str_buf(&addr, tp->name, MAXNAMELEN); } } @@ -1122,7 +1122,7 @@ new_ipv4(const guint addr) tp->addr = addr; tp->flags = 0; tp->name[0] = '\0'; - ip_to_str_buf((const guint8 *)&addr, tp->ip, sizeof(tp->ip)); + ip_addr_to_str_buf(&addr, tp->ip, sizeof(tp->ip)); return tp; } |