2
0
Эх сурвалжийг харах

ipops: use INET6_ADDRSTRLEN constant for IPv4/IPv6 maximun size.

Iñaki Baz Castillo 14 жил өмнө
parent
commit
62f96b72d1

+ 1 - 1
modules/ipops/ipops_mod.c

@@ -133,7 +133,7 @@ static int _compare_ips(char *ip1, size_t len1, enum enum_ip_type ip1_type, char
 {
 {
   struct in_addr in_addr1, in_addr2;
   struct in_addr in_addr1, in_addr2;
   struct in6_addr in6_addr1, in6_addr2;
   struct in6_addr in6_addr1, in6_addr2;
-  char _ip1[40], _ip2[40];
+  char _ip1[INET6_ADDRSTRLEN], _ip2[INET6_ADDRSTRLEN];
   
   
   // Not same IP type, return false.
   // Not same IP type, return false.
   if (ip1_type != ip2_type)
   if (ip1_type != ip2_type)