diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2014-02-10 16:42:46 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2014-02-10 16:42:46 +0000 |
commit | 1633e3083445e7e6fa6dcb948a4fcf1fe41c814b (patch) | |
tree | 03cf3ddca6879ebddfc1ab15f807915ac70fc686 | |
parent | c8ca33f810e25e15296926f569c8e82420d5fdd3 (diff) | |
download | dnsmasq-1633e3083445e7e6fa6dcb948a4fcf1fe41c814b.tar.gz |
Fix Byte-order botch: broke DNSSEC on big-endian platforms.
-rw-r--r-- | src/dnssec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dnssec.c b/src/dnssec.c index b97f47b..002afbc 100644 --- a/src/dnssec.c +++ b/src/dnssec.c @@ -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; } |