mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 09:07:02 +02:00
CLEANUP/MINOR: standard: use the system define INET6_ADDRSTRLEN in place of MAX_IP6_LEN
This commit is contained in:
parent
736459eab8
commit
cd6599150f
@ -1696,12 +1696,11 @@ int buf2ip(const char *buf, size_t len, struct in_addr *dst)
|
|||||||
* struct in6_addr <dst> which must be allocated by the caller.
|
* struct in6_addr <dst> which must be allocated by the caller.
|
||||||
* This function returns 1 in success case, otherwise zero.
|
* This function returns 1 in success case, otherwise zero.
|
||||||
*/
|
*/
|
||||||
#define MAX_IP6_LEN 45
|
|
||||||
int buf2ip6(const char *buf, size_t len, struct in6_addr *dst)
|
int buf2ip6(const char *buf, size_t len, struct in6_addr *dst)
|
||||||
{
|
{
|
||||||
char null_term_ip6[MAX_IP6_LEN + 1];
|
char null_term_ip6[INET6_ADDRSTRLEN + 1];
|
||||||
|
|
||||||
if (len > MAX_IP6_LEN)
|
if (len > INET6_ADDRSTRLEN)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
memcpy(null_term_ip6, buf, len);
|
memcpy(null_term_ip6, buf, len);
|
||||||
|
Loading…
Reference in New Issue
Block a user