]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fix p_ancil
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 16 Mar 2010 15:20:40 +0000 (15:20 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 16 Mar 2010 15:20:40 +0000 (15:20 +0000)
git-svn-id: file:///svn/unbound/trunk@2043 be551aaa-1e26-0410-a405-d3ace91eadb9

util/netevent.c

index abdd07ee204589922729e0b0f02e4f6176454921..2c0a9577e7cb45128da4b0ba4df3e4f7e5b9baac 100644 (file)
@@ -317,15 +317,7 @@ void p_ancil(const char* str, struct comm_reply* r)
                buf[sizeof(buf)-1]=0;
                log_info("%s: %s %d", str, buf, r->pktinfo.v6info.ipi6_ifindex);
        } else if(r->srctype == 4) {
-#ifdef IP_RECVDSTADDR
-               char buf1[1024];
-               if(inet_ntop(AF_INET, &r->pktinfo.v4addr, 
-                       buf1, (socklen_t)sizeof(buf1)) == 0) {
-                       strncpy(buf1, "(inet_ntop error)", sizeof(buf1));
-               }
-               buf1[sizeof(buf1)-1]=0;
-               log_info("%s: %s", str, buf1);
-#elif defined(IP_PKTINFO)
+#ifdef IP_PKTINFO
                char buf1[1024], buf2[1024];
                if(inet_ntop(AF_INET, &r->pktinfo.v4info.ipi_addr, 
                        buf1, (socklen_t)sizeof(buf1)) == 0) {
@@ -339,6 +331,14 @@ void p_ancil(const char* str, struct comm_reply* r)
                buf2[sizeof(buf2)-1]=0;
                log_info("%s: %d %s %s", str, r->pktinfo.v4info.ipi_ifindex,
                        buf1, buf2);
+#elif defined(IP_RECVDSTADDR)
+               char buf1[1024];
+               if(inet_ntop(AF_INET, &r->pktinfo.v4addr, 
+                       buf1, (socklen_t)sizeof(buf1)) == 0) {
+                       strncpy(buf1, "(inet_ntop error)", sizeof(buf1));
+               }
+               buf1[sizeof(buf1)-1]=0;
+               log_info("%s: %s", str, buf1);
 #endif
        }
 #else