]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - lib/rfc3596.c
SourceFormat Enforcement
[thirdparty/squid.git] / lib / rfc3596.c
index 3d64b104f4edfb8fa38bb349cf06b6065c484ba8..7d4a2a222632cb2c1a8a3ef7c43c7ba82d22aec8 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * Low level DNS protocol routines
  * AUTHOR: Amos Jeffries, Rafael Martinez Torres
  *
@@ -55,7 +53,7 @@
  *
  */
 
-#include "config.h"
+#include "squid.h"
 #include "compat/inet_pton.h"
 #include "util.h"
 
@@ -78,8 +76,8 @@
 #include <strings.h>
 #endif
 
-#include "rfc3596.h"
 #include "rfc2671.h"
+#include "rfc3596.h"
 
 #ifndef SQUID_RFC1035_H
 #error RFC3596 Library depends on RFC1035
@@ -152,7 +150,6 @@ rfc3596BuildAAAAQuery(const char *hostname, char *buf, size_t sz, unsigned short
     return rfc3596BuildHostQuery(hostname, buf, sz, qid, query, RFC1035_TYPE_AAAA, edns_sz);
 }
 
-
 /**
  * Builds a message buffer with a QUESTION to lookup PTR records
  * for an address.  Caller must allocate 'buf' which should
@@ -188,7 +185,7 @@ rfc3596BuildPTRQuery6(const struct in6_addr addr, char *buf, size_t sz, unsigned
     /* work from the raw addr field. anything else may have representation changes. */
     /* The sin6_port and sin6_addr members shall be in network byte order. */
     for (i = 15; i >= 0; i--, p+=4) {
-        snprintf(p, 5, "%1x.%1x.", ((r[i]>>4)&0xf), (r[i])&0xf );
+        snprintf(p, 5, "%1x.%1x.", ((r[i])&0xf), (r[i]>>4)&0xf );
     }
 
     snprintf(p,10,"ip6.arpa.");
@@ -196,7 +193,6 @@ rfc3596BuildPTRQuery6(const struct in6_addr addr, char *buf, size_t sz, unsigned
     return rfc3596BuildHostQuery(rev, buf, sz, qid, query, RFC1035_TYPE_PTR, edns_sz);
 }
 
-
 #if DRIVER
 
 /* driver needs the rfc1035 code _without_ the main() */
@@ -253,7 +249,6 @@ main(int argc, char *argv[])
         return 1;
     }
 
-
     memset(&S, '\0', sizeof(S));
 
     if (prefer == 6) {