In kpasswd_sendto_msg_callback(), properly compare against the
authorGreg Hudson <ghudson@mit.edu>
Thu, 22 Apr 2010 03:19:34 +0000 (03:19 +0000)
committerGreg Hudson <ghudson@mit.edu>
Thu, 22 Apr 2010 03:19:34 +0000 (03:19 +0000)
wildcard IPv6 address instead of comparing an array address to 0.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23921 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/changepw.c

index 7cab0d63d1f0b4be0381faa492c0f55d979fdf36..25840b6d58c6d61531fcd554637b7c8b7d592b38 100644 (file)
@@ -140,7 +140,8 @@ kpasswd_sendto_msg_callback(struct conn_state *conn,
         local_kaddr.length = sizeof(ss2sin(&local_addr)->sin_addr);
         local_kaddr.contents = (krb5_octet *) &ss2sin(&local_addr)->sin_addr;
     } else if (local_addr.ss_family == AF_INET6 &&
-               ss2sin6(&local_addr)->sin6_addr.s6_addr != 0) {
+               memcmp(ss2sin6(&local_addr)->sin6_addr.s6_addr,
+                      in6addr_any.s6_addr, sizeof(in6addr_any.s6_addr)) != 0) {
         local_kaddr.addrtype = ADDRTYPE_INET6;
         local_kaddr.length = sizeof(ss2sin6(&local_addr)->sin6_addr);
         local_kaddr.contents = (krb5_octet *) &ss2sin6(&local_addr)->sin6_addr;