From f669c7a3fbb83e932ae651f3be57e5f10d6f95e2 Mon Sep 17 00:00:00 2001
From: Eric Leblond <eric@regit.org>
Date: Mon, 29 Aug 2011 14:58:33 +0200
Subject: [PATCH 2/2] Transform inet_ntop call into PrintInet one.

---
 src/alert-debuglog.c        |    8 ++++----
 src/alert-fastlog.c         |    8 ++++----
 src/alert-prelude.c         |    8 ++++----
 src/alert-syslog.c          |    8 ++++----
 src/app-layer-parser.c      |    8 ++++----
 src/decode-icmpv4.c         |   17 +++++++++--------
 src/decode-icmpv6.c         |    5 +++--
 src/decode-ipv4.c           |    5 +++--
 src/decode-ipv6.c           |    7 ++++---
 src/decode.c                |    3 ++-
 src/detect-engine-address.c |    9 +++++----
 src/detect-engine-iponly.c  |    3 ++-
 src/log-droplog.c           |    8 ++++----
 src/log-httplog.c           |   16 ++++++++--------
 14 files changed, 60 insertions(+), 53 deletions(-)

diff --git a/src/alert-debuglog.c b/src/alert-debuglog.c
index 6130823..b3a8bf5 100644
--- a/src/alert-debuglog.c
+++ b/src/alert-debuglog.c
@@ -186,8 +186,8 @@ TmEcode AlertDebugLogIPv4(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq
     }
 
     char srcip[16], dstip[16];
-    inet_ntop(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
-    inet_ntop(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
+    PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
+    PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
 
     fprintf(aft->file_ctx->fp, "SRC IP:            %s\n", srcip);
     fprintf(aft->file_ctx->fp, "DST IP:            %s\n", dstip);
@@ -298,8 +298,8 @@ TmEcode AlertDebugLogIPv6(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq
 
         char srcip[46], dstip[46];
 
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
 
         fprintf(aft->file_ctx->fp, "%s  [**] [%" PRIu32 ":%" PRIu32 ":%" PRIu32 "] %s [**] [Classification: fixme] [Priority: %" PRIu32 "] {%" PRIu32 "} %s:%" PRIu32 " -> %s:%" PRIu32 "\n",
             timebuf, pa->s->gid, pa->s->id, pa->s->rev, pa->s->msg, pa->s->prio, IPV6_GET_L4PROTO(p), srcip, p->sp, dstip, p->dp);
diff --git a/src/alert-fastlog.c b/src/alert-fastlog.c
index f8f4088..34906f8 100644
--- a/src/alert-fastlog.c
+++ b/src/alert-fastlog.c
@@ -143,8 +143,8 @@ TmEcode AlertFastLogIPv4(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq,
 
         char srcip[16], dstip[16];
 
-        inet_ntop(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
 
         if (pa->action == ACTION_DROP && IS_ENGINE_MODE_IPS(engine_mode)) {
             action = "[Drop] ";
@@ -200,8 +200,8 @@ TmEcode AlertFastLogIPv6(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq,
 
         char srcip[46], dstip[46];
 
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
 
         if (pa->action == ACTION_DROP && IS_ENGINE_MODE_IPS(engine_mode)) {
             action = "[Drop] ";
diff --git a/src/alert-prelude.c b/src/alert-prelude.c
index fbfc6a4..27070d9 100644
--- a/src/alert-prelude.c
+++ b/src/alert-prelude.c
@@ -286,13 +286,13 @@ static int EventToSourceTarget(Packet *p, idmef_alert_t *alert)
     if (PKT_IS_IPV4(p)) {
         ip_vers = 4;
         ip_proto = IPV4_GET_RAW_IPPROTO(p->ip4h);
-        inet_ntop(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), saddr, sizeof(saddr));
-        inet_ntop(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), daddr, sizeof(daddr));
+        PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), saddr, sizeof(saddr));
+        PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), daddr, sizeof(daddr));
     } else if (PKT_IS_IPV6(p)) {
         ip_vers = 6;
         ip_proto = IPV6_GET_L4PROTO(p);
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), saddr, sizeof(saddr));
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), daddr, sizeof(daddr));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), saddr, sizeof(saddr));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), daddr, sizeof(daddr));
     } else
         SCReturnInt(0);
 
diff --git a/src/alert-syslog.c b/src/alert-syslog.c
index d6e865d..6c9e9a5 100644
--- a/src/alert-syslog.c
+++ b/src/alert-syslog.c
@@ -275,8 +275,8 @@ TmEcode AlertSyslogIPv4(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq,
 
         char srcip[16], dstip[16];
 
-        inet_ntop(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
 
         if (pa->action == ACTION_DROP && IS_ENGINE_MODE_IPS(engine_mode)) {
             action = "[Drop] ";
@@ -336,8 +336,8 @@ TmEcode AlertSyslogIPv6(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq,
 
         char srcip[46], dstip[46];
 
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
 
         if (pa->action == ACTION_DROP && IS_ENGINE_MODE_IPS(engine_mode)) {
             action = "[Drop] ";
diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c
index 69b2a9b..6ed9c5f 100644
--- a/src/app-layer-parser.c
+++ b/src/app-layer-parser.c
@@ -943,9 +943,9 @@ error:
         if (f->src.family == AF_INET) {
             char src[16];
             char dst[16];
-            inet_ntop(AF_INET, (const void*)&f->src.addr_data32[0], src,
+            PrintInet(AF_INET, (const void*)&f->src.addr_data32[0], src,
                       sizeof (src));
-            inet_ntop(AF_INET, (const void*)&f->dst.addr_data32[0], dst,
+            PrintInet(AF_INET, (const void*)&f->dst.addr_data32[0], dst,
                       sizeof (dst));
 
             SCLogError(SC_ERR_ALPARSER, "Error occured in parsing \"%s\" app layer "
@@ -957,9 +957,9 @@ error:
             char dst6[46];
             char src6[46];
 
-            inet_ntop(AF_INET6, (const void*)&f->src.addr_data32, src6,
+            PrintInet(AF_INET6, (const void*)&f->src.addr_data32, src6,
                       sizeof (src6));
-            inet_ntop(AF_INET6, (const void*)&f->dst.addr_data32, dst6,
+            PrintInet(AF_INET6, (const void*)&f->dst.addr_data32, dst6,
                       sizeof (dst6));
 
             SCLogError(SC_ERR_ALPARSER, "Error occured in parsing \"%s\" app layer "
diff --git a/src/decode-icmpv4.c b/src/decode-icmpv4.c
index 4bf3f2c..080e649 100644
--- a/src/decode-icmpv4.c
+++ b/src/decode-icmpv4.c
@@ -35,6 +35,7 @@
 #include "util-unittest.h"
 #include "util-unittest-helper.h"
 #include "util-debug.h"
+#include "util-print.h"
 
 /**
  * Note, this is the IP header, plus a bit of the original packet, not the whole thing!
@@ -130,8 +131,8 @@ void DecodePartialIPV4( Packet* p, uint8_t* partial_packet, uint16_t len )
     /* debug print */
 #ifdef DEBUG
     char s[16], d[16];
-    inet_ntop(AF_INET, &(p->icmpv4vars.emb_ip4_src), s, sizeof(s));
-    inet_ntop(AF_INET, &(p->icmpv4vars.emb_ip4_dst), d, sizeof(d));
+    PrintInet(AF_INET, &(p->icmpv4vars.emb_ip4_src), s, sizeof(s));
+    PrintInet(AF_INET, &(p->icmpv4vars.emb_ip4_dst), d, sizeof(d));
     SCLogDebug("ICMPv4 embedding IPV4 %s->%s - PROTO: %" PRIu32 " ID: %" PRIu32 "", s,d,
             IPV4_GET_RAW_IPPROTO(icmp4_ip4h), IPV4_GET_RAW_IPID(icmp4_ip4h));
 #endif
@@ -462,8 +463,8 @@ static int DecodeICMPV4test03(void) {
     /* check the src,dst IPs contained inside */
     char s[16], d[16];
 
-    inet_ntop(AF_INET, &(p->icmpv4vars.emb_ip4_src), s, sizeof(s));
-    inet_ntop(AF_INET, &(p->icmpv4vars.emb_ip4_dst), d, sizeof(d));
+    PrintInet(AF_INET, &(p->icmpv4vars.emb_ip4_src), s, sizeof(s));
+    PrintInet(AF_INET, &(p->icmpv4vars.emb_ip4_dst), d, sizeof(d));
 
     /* ICMPv4 embedding IPV4 192.168.1.13->209.85.227.147 pass */
     if (strcmp(s, "192.168.1.13") == 0 && strcmp(d, "209.85.227.147") == 0) {
@@ -537,8 +538,8 @@ static int DecodeICMPV4test04(void) {
     // check the src,dst IPs contained inside
     char s[16], d[16];
 
-    inet_ntop(AF_INET, &(p->icmpv4vars.emb_ip4_src), s, sizeof(s));
-    inet_ntop(AF_INET, &(p->icmpv4vars.emb_ip4_dst), d, sizeof(d));
+    PrintInet(AF_INET, &(p->icmpv4vars.emb_ip4_src), s, sizeof(s));
+    PrintInet(AF_INET, &(p->icmpv4vars.emb_ip4_dst), d, sizeof(d));
 
     // ICMPv4 embedding IPV4 192.168.1.13->88.96.22.41
     if (strcmp(s, "192.168.1.13") == 0 && strcmp(d, "88.96.22.41") == 0) {
@@ -607,8 +608,8 @@ static int DecodeICMPV4test05(void) {
     // check the src,dst IPs contained inside
     char s[16], d[16];
 
-    inet_ntop(AF_INET, &(p->icmpv4vars.emb_ip4_src), s, sizeof(s));
-    inet_ntop(AF_INET, &(p->icmpv4vars.emb_ip4_dst), d, sizeof(d));
+    PrintInet(AF_INET, &(p->icmpv4vars.emb_ip4_src), s, sizeof(s));
+    PrintInet(AF_INET, &(p->icmpv4vars.emb_ip4_dst), d, sizeof(d));
 
     // ICMPv4 embedding IPV4 192.168.2.5->61.35.161.35
     if (strcmp(s, "192.168.2.5") == 0 && strcmp(d, "61.35.161.35") == 0) {
diff --git a/src/decode-icmpv6.c b/src/decode-icmpv6.c
index 6c87165..3346cc4 100644
--- a/src/decode-icmpv6.c
+++ b/src/decode-icmpv6.c
@@ -33,6 +33,7 @@
 #include "util-unittest.h"
 #include "flow.h"
 #include "util-debug.h"
+#include "util-print.h"
 
 
 /**
@@ -129,8 +130,8 @@ void DecodePartialIPV6(Packet *p, uint8_t *partial_packet, uint16_t len )
     /* debug print */
 #ifdef DEBUG
     char s[46], d[46];
-    inet_ntop(AF_INET6, (const void *)p->icmpv6vars.emb_ip6_src, s, sizeof(s));
-    inet_ntop(AF_INET6, (const void *)p->icmpv6vars.emb_ip6_dst, d, sizeof(d));
+    PrintInet(AF_INET6, (const void *)p->icmpv6vars.emb_ip6_src, s, sizeof(s));
+    PrintInet(AF_INET6, (const void *)p->icmpv6vars.emb_ip6_dst, d, sizeof(d));
     SCLogDebug("ICMPv6 embedding IPV6 %s->%s - CLASS: %" PRIu32 " FLOW: "
                "%" PRIu32 " NH: %" PRIu32 " PLEN: %" PRIu32 " HLIM: %" PRIu32,
                s, d, IPV6_GET_RAW_CLASS(icmp6_ip6h), IPV6_GET_RAW_FLOW(icmp6_ip6h),
diff --git a/src/decode-ipv4.c b/src/decode-ipv4.c
index 076b290..2af4ac4 100644
--- a/src/decode-ipv4.c
+++ b/src/decode-ipv4.c
@@ -35,6 +35,7 @@
 #include "util-unittest.h"
 #include "util-debug.h"
 #include "util-optimize.h"
+#include "util-print.h"
 
 /* Generic validation
  *
@@ -533,8 +534,8 @@ void DecodeIPV4(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt,
     if (SCLogDebugEnabled()) { /* only convert the addresses if debug is really enabled */
         /* debug print */
         char s[16], d[16];
-        inet_ntop(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), s, sizeof(s));
-        inet_ntop(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), d, sizeof(d));
+        PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), s, sizeof(s));
+        PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), d, sizeof(d));
         SCLogDebug("IPV4 %s->%s PROTO: %" PRIu32 " OFFSET: %" PRIu32 " RF: %" PRIu32 " DF: %" PRIu32 " MF: %" PRIu32 " ID: %" PRIu32 "", s,d,
                 IPV4_GET_IPPROTO(p), IPV4_GET_IPOFFSET(p), IPV4_GET_RF(p),
                 IPV4_GET_DF(p), IPV4_GET_MF(p), IPV4_GET_IPID(p));
diff --git a/src/decode-ipv6.c b/src/decode-ipv6.c
index 2882322..0b260f8 100644
--- a/src/decode-ipv6.c
+++ b/src/decode-ipv6.c
@@ -31,6 +31,7 @@
 #include "decode-events.h"
 #include "defrag.h"
 #include "util-debug.h"
+#include "util-print.h"
 
 #define IPV6_EXTHDRS     ip6eh.ip6_exthdrs
 #define IPV6_EH_CNT      ip6eh.ip6_exthdrs_cnt
@@ -249,7 +250,7 @@ DecodeIPV6ExtHdrs(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt
                         //printf("HAO option: type %" PRIu32 " len %" PRIu32 " ",
                         //    hao->ip6hao_type, hao->ip6hao_len);
                         //char addr_buf[46];
-                        //inet_ntop(AF_INET6, (char *)&(hao->ip6hao_hoa),
+                        //PrintInet(AF_INET6, (char *)&(hao->ip6hao_hoa),
                         //    addr_buf,sizeof(addr_buf));
                         //printf("home addr %s\n", addr_buf);
                     }
@@ -427,8 +428,8 @@ void DecodeIPV6(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt,
     if (SCLogDebugEnabled()) { /* only convert the addresses if debug is really enabled */
         /* debug print */
         char s[46], d[46];
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), s, sizeof(s));
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), d, sizeof(d));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), s, sizeof(s));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), d, sizeof(d));
         SCLogDebug("IPV6 %s->%s - CLASS: %" PRIu32 " FLOW: %" PRIu32 " NH: %" PRIu32 " PLEN: %" PRIu32 " HLIM: %" PRIu32 "", s,d,
                 IPV6_GET_CLASS(p), IPV6_GET_FLOW(p), IPV6_GET_NH(p), IPV6_GET_PLEN(p),
                 IPV6_GET_HLIM(p));
diff --git a/src/decode.c b/src/decode.c
index 856bdf7..aea1a4f 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -31,6 +31,7 @@
 #include "app-layer-detect-proto.h"
 #include "tm-modules.h"
 #include "util-error.h"
+#include "util-print.h"
 #include "tmqh-packetpool.h"
 
 void DecodeTunnel(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
@@ -224,7 +225,7 @@ void AddressDebugPrint(Address *a) {
         case AF_INET:
         {
             char s[16];
-            inet_ntop(AF_INET, (const void *)&a->addr_data32[0], s, sizeof(s));
+            PrintInet(AF_INET, (const void *)&a->addr_data32[0], s, sizeof(s));
             SCLogDebug("%s", s);
             break;
         }
diff --git a/src/detect-engine-address.c b/src/detect-engine-address.c
index f962980..e76b32c 100644
--- a/src/detect-engine-address.c
+++ b/src/detect-engine-address.c
@@ -42,6 +42,7 @@
 #include "detect-engine-port.h"
 
 #include "util-debug.h"
+#include "util-print.h"
 
 void DetectAddressTests(void);
 
@@ -1563,9 +1564,9 @@ void DetectAddressPrint(DetectAddress *gr)
         char ip[16], mask[16];
 
         memcpy(&in, &gr->ip.addr_data32[0], sizeof(in));
-        inet_ntop(AF_INET, &in, ip, sizeof(ip));
+        PrintInet(AF_INET, &in, ip, sizeof(ip));
         memcpy(&in, &gr->ip2.addr_data32[0], sizeof(in));
-        inet_ntop(AF_INET, &in, mask, sizeof(mask));
+        PrintInet(AF_INET, &in, mask, sizeof(mask));
 
         SCLogDebug("%s/%s", ip, mask);
 //        printf("%s/%s", ip, mask);
@@ -1574,9 +1575,9 @@ void DetectAddressPrint(DetectAddress *gr)
         char ip[66], mask[66];
 
         memcpy(&in6, &gr->ip, sizeof(in6));
-        inet_ntop(AF_INET6, &in6, ip, sizeof(ip));
+        PrintInet(AF_INET6, &in6, ip, sizeof(ip));
         memcpy(&in6, &gr->ip2, sizeof(in6));
-        inet_ntop(AF_INET6, &in6, mask, sizeof(mask));
+        PrintInet(AF_INET6, &in6, mask, sizeof(mask));
 
         SCLogDebug("%s/%s", ip, mask);
 //        printf("%s/%s", ip, mask);
diff --git a/src/detect-engine-iponly.c b/src/detect-engine-iponly.c
index b6205fb..8932a0d 100644
--- a/src/detect-engine-iponly.c
+++ b/src/detect-engine-iponly.c
@@ -52,6 +52,7 @@
 #include "util-debug.h"
 #include "util-unittest.h"
 #include "util-unittest-helper.h"
+#include "util-print.h"
 
 #ifdef OS_WIN32
 #include <winsock.h>
@@ -1149,7 +1150,7 @@ void IPOnlyPrepare(DetectEngineCtx *de_ctx) {
 
                     if (node == NULL) {
                         char tmpstr[64];
-                        inet_ntop(src->family, &src->ip[0], tmpstr, sizeof(tmpstr));
+                        PrintInet(src->family, &src->ip[0], tmpstr, sizeof(tmpstr));
                         SCLogError(SC_ERR_IPONLY_RADIX, "Error inserting in the"
                                    " src ipv4 radix tree ip %s netmask %"PRIu8, tmpstr, src->netmask);
                         //SCRadixPrintTree((de_ctx->io_ctx).tree_ipv4src);
diff --git a/src/log-droplog.c b/src/log-droplog.c
index 16ae585..c2b8d4a 100644
--- a/src/log-droplog.c
+++ b/src/log-droplog.c
@@ -273,16 +273,16 @@ TmEcode LogDropLogNetFilter (ThreadVars *tv, Packet *p, void *data, PacketQueue
     char dstip[46] = "";
 
     if (PKT_IS_IPV4(p)) {
-        inet_ntop(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, 16);
-        inet_ntop(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, 16);
+        PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, 16);
+        PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, 16);
         fprintf(dlt->file_ctx->fp, "%s: IN= OUT= SRC=%s DST=%s LEN=%"PRIu16" "
                 "TOS=0x%02"PRIu8" TTL=%"PRIu8" ID=%"PRIu16"", timebuf,
                 srcip, dstip, IPV4_GET_IPLEN(p), IPV4_GET_IPTOS(p),
                 IPV4_GET_IPTTL(p), IPV4_GET_IPID(p));
         proto = IPV4_GET_IPPROTO(p);
     } else if (PKT_IS_IPV6(p)) {
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
         fprintf(dlt->file_ctx->fp, "%s: IN= OUT= SRC=%s DST=%s LEN=%"PRIu16""
                 " TC=%"PRIu32" HOPLIMIT=%"PRIu8" FLOWLBL=%"PRIu32"", timebuf,
                 srcip, dstip, IPV6_GET_PLEN(p), IPV6_GET_CLASS(p),
diff --git a/src/log-httplog.c b/src/log-httplog.c
index 647498a..a8cba45 100644
--- a/src/log-httplog.c
+++ b/src/log-httplog.c
@@ -151,13 +151,13 @@ TmEcode LogHttpLogIPv4(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, P
     char srcip[16], dstip[16];
     Port sp, dp;
     if ((PKT_IS_TOSERVER(p))) {
-        inet_ntop(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), dstip, sizeof(dstip));
         sp = p->sp;
         dp = p->dp;
     } else {
-        inet_ntop(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET, (const void *)GET_IPV4_DST_ADDR_PTR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET, (const void *)GET_IPV4_SRC_ADDR_PTR(p), dstip, sizeof(dstip));
         sp = p->dp;
         dp = p->sp;
     }
@@ -267,13 +267,13 @@ TmEcode LogHttpLogIPv6(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, P
     char srcip[46], dstip[46];
     Port sp, dp;
     if ((PKT_IS_TOSERVER(p))) {
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
         sp = p->sp;
         dp = p->dp;
     } else {
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
-        inet_ntop(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_SRC_ADDR(p), srcip, sizeof(srcip));
+        PrintInet(AF_INET6, (const void *)GET_IPV6_DST_ADDR(p), dstip, sizeof(dstip));
         sp = p->dp;
         dp = p->sp;
     }
-- 
1.7.5.4

