]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Fix Byte-order botch: broke DNSSEC on big-endian platforms.
authorSimon Kelley <simon@thekelleys.org.uk>
Mon, 10 Feb 2014 16:42:46 +0000 (16:42 +0000)
committerSimon Kelley <simon@thekelleys.org.uk>
Mon, 10 Feb 2014 16:42:46 +0000 (16:42 +0000)
src/dnssec.c

index b97f47b112bd74217ad8e0225d8f3f1182de24bf..002afbcda7d278725d0bb8789b2784e8243c3243 100644 (file)
@@ -1374,12 +1374,12 @@ int dnskey_keytag(int alg, int flags, unsigned char *key, int keylen)
     }
   else
     {
-      unsigned long ac;
+      unsigned long ac = flags + 0x300 + alg;
       int i;
 
-      ac = ((htons(flags) >> 8) | ((htons(flags) << 8) & 0xff00)) + 0x300 + alg;
       for (i = 0; i < keylen; ++i)
         ac += (i & 1) ? key[i] : key[i] << 8;
+
       ac += (ac >> 16) & 0xffff;
       return ac & 0xffff;
     }