]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Do this in a more obvious way. The result is that the bytes are now swapped
authorJohn Hay <hay@ntp.org>
Sat, 7 Sep 2002 13:24:13 +0000 (15:24 +0200)
committerJohn Hay <hay@ntp.org>
Sat, 7 Sep 2002 13:24:13 +0000 (15:24 +0200)
compared to the previous way.

bk: 3d79fdfdmhkiYHtrxbq4qpB21FyXZA

libntp/a_md5encrypt.c

index a65b02ba48b4e5455e360130d47ec05ea327311f..51a7d5f9717cefd863a96dd18549e290cca7b6de 100644 (file)
@@ -99,12 +99,6 @@ addr2refid(struct sockaddr_storage *addr)
        MD5Update(&md5, (u_char *)&GET_INADDR6(*addr),
            sizeof(struct in6_addr));
        MD5Final(digest, &md5);
-       addr_refid = digest[0];
-       addr_refid <<= 8;
-       addr_refid |= digest[1];
-       addr_refid <<= 8;
-       addr_refid |= digest[2];
-       addr_refid <<= 8;
-       addr_refid |= digest[3];
+       memcpy(&addr_refid, digest, 4);
        return (htonl(addr_refid));
 }