[ULOGD PATCH 5/9] Fix crash IP2BIN and IP2STR due to ui128 type introduction.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



IP2BIN and IP2STR were using the ptr field of the value but the type used
for IPv6 address is now ui128. This patch fix this problem by using ui128
instead of ptr.

Signed-off-by: Eric Leblond <eric@xxxxxx>
---
 filter/ulogd_filter_IP2BIN.c |    2 +-
 filter/ulogd_filter_IP2STR.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/filter/ulogd_filter_IP2BIN.c b/filter/ulogd_filter_IP2BIN.c
index 33db6a2..7412e38 100644
--- a/filter/ulogd_filter_IP2BIN.c
+++ b/filter/ulogd_filter_IP2BIN.c
@@ -137,7 +137,7 @@ static char *ip2bin(struct ulogd_key* inp, int index, char family)
 
 	switch (family) {
 		case AF_INET6:
-			addr = GET_VALUE(inp, index).ptr;
+			addr = GET_VALUE(inp, index).ui128;
 			break;
 		case AF_INET:
 			/* Convert IPv4 to IPv4 in IPv6 */
diff --git a/filter/ulogd_filter_IP2STR.c b/filter/ulogd_filter_IP2STR.c
index e4ec06d..9ad3b81 100644
--- a/filter/ulogd_filter_IP2STR.c
+++ b/filter/ulogd_filter_IP2STR.c
@@ -174,7 +174,7 @@ static char *ip2str(struct ulogd_key *inp, int index)
 	switch (convfamily) {
 	case AF_INET6:
 		inet_ntop(AF_INET6,
-			  GET_VALUE(inp, index).ptr,
+			  GET_VALUE(inp, index).ui128,
 			  tmp, sizeof(tmp));
 		break;
 	case AF_INET:
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux