Skip to contentSkip to conversation

Fix crash IP2BIN and IP2STR due to ui128 type introduction.

PATCH Applied Eric Leblond 2 participants 2 messages May 19, 2008 – Jun 1, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

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

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.

---
 filter/ulogd_filter_IP2BIN.c |    2 +-
 filter/ulogd_filter_IP2STR.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
filter/ulogd_filter_IP2BIN.c +1 -1
index 33db6a2..7412e38 100644
@@ -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 */
filter/ulogd_filter_IP2STR.c +1 -1
index e4ec06d..9ad3b81 100644
@@ -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:
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 3 lines · Eric Leblond

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.

I have merged this to 02cleanup.patch. Thanks.

Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers