mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-15 15:27:00 +00:00
other: use IP string lengths from netinet/in.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
71714a0993
commit
008e9f17c1
1 changed files with 2 additions and 2 deletions
|
|
@ -298,7 +298,7 @@ const char *ntop_ipaddr_init(const union ipaddr_t *ip __attribute__ ((unused)))
|
|||
|
||||
const char *ntop_ipaddr_v4(const union ipaddr_t *ip)
|
||||
{
|
||||
static char buffer[sizeof("255.255.255.255")];
|
||||
static char buffer[INET_ADDRSTRLEN];
|
||||
struct in_addr addr;
|
||||
|
||||
addr.s_addr = htonl(ip->v4);
|
||||
|
|
@ -307,7 +307,7 @@ const char *ntop_ipaddr_v4(const union ipaddr_t *ip)
|
|||
|
||||
const char *ntop_ipaddr_v6(const union ipaddr_t *ip)
|
||||
{
|
||||
static char buffer[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
|
||||
static char buffer[INET6_ADDRSTRLEN];
|
||||
struct in6_addr addr;
|
||||
|
||||
memcpy(addr.s6_addr, ip->v6, sizeof(addr.s6_addr));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue