]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Fix DNSSEC crash retrying to IPv6 server.
authorSimon Kelley <simon@thekelleys.org.uk>
Fri, 21 Mar 2014 11:13:55 +0000 (11:13 +0000)
committerSimon Kelley <simon@thekelleys.org.uk>
Fri, 21 Mar 2014 11:13:55 +0000 (11:13 +0000)
src/forward.c

index c59777ea5d39f5c0da031d7928b7f9bdcff4bc1b..4dc3dcaba5ecc942c2bca7b903d8b0b2604b99b4 100644 (file)
@@ -278,7 +278,7 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
          blockdata_retrieve(forward->stash, forward->stash_len, (void *)header);
          plen = forward->stash_len;
          
-         if (forward->sentto->addr.sa.sa_family) 
+         if (forward->sentto->addr.sa.sa_family == AF_INET
            log_query(F_DNSSEC | F_IPV4, "retry", (struct all_addr *)&forward->sentto->addr.in.sin_addr, "dnssec");
 #ifdef HAVE_IPV6
          else
@@ -299,7 +299,7 @@ static int forward_query(int udpfd, union mysockaddr *udpaddr,
          
          while (sendto(fd, (char *)header, plen, 0,
                        &forward->sentto->addr.sa,
-                           sa_len(&forward->sentto->addr)) == -1 && retry_send());
+                       sa_len(&forward->sentto->addr)) == -1 && retry_send());
          
          return 1;
        }