1. 31 Oct, 2017 2 commits
  2. 30 Oct, 2017 1 commit
  3. 28 Oct, 2017 5 commits
  4. 26 Oct, 2017 1 commit
    • Simon Kelley's avatar
      Fix caching logic for validated answers. · a6004d7f
      Simon Kelley authored
      The current logic is naive in the case that there is more than
      one RRset in an answer (Typically, when a non-CNAME query is answered
      by one or more CNAME RRs, and then then an answer RRset.)
      
      If all the RRsets validate, then they are cached and marked as validated,
      but if any RRset doesn't validate, then the AD flag is not set (good) and
      ALL the RRsets are cached marked as not validated.
      
      This breaks when, eg, the answer contains a validated CNAME, pointing
      to a non-validated answer. A subsequent query for the CNAME without do
      will get an answer with the AD flag wrongly reset, and worse, the same
      query with do will get a cached answer without RRSIGS, rather than
      being forwarded.
      
      The code now records the validation of individual RRsets and that
      is used to correctly set the "validated" bits in the cache entries.
      a6004d7f
  5. 14 Oct, 2017 4 commits
    • Simon Kelley's avatar
      Tidy up add_resource_record() buffer size checks. · c366717e
      Simon Kelley authored
      Mainly code-size and readability fixes.
      
      Also return NULL from do_rfc1035_name() when limit exceeded, so
      that truncated bit gets set in answer.
      c366717e
    • Simon Kelley's avatar
      Log DNS server max packet size reduction. · 22dee512
      Simon Kelley authored
      22dee512
    • Simon Kelley's avatar
      Fix logic on EDNS0 headers. · 6fd5d79e
      Simon Kelley authored
      The logic to determine is an EDNS0 header was added was wrong. It compared
      the packet length before and after the operations on the EDNS0 header,
      but these can include adding options to an existing EDNS0 header. So
      a query may have an existing EDNS0 header, which is extended, and logic
      thinks that it had a header added de-novo.
      
      Replace this with a simpler system. Check if the packet has an EDSN0 header,
      do the updates/additions, and then check again. If it didn't have one
      initially, but it has one laterly, that's the correct condition
      to strip the header from a reply, and to assume that the client
      cannot handle packets larger than 512 bytes.
      6fd5d79e
    • Simon Kelley's avatar
      Use IP[V6]_UNICAST_IF socket option instead of SO_BINDTODEVICE for DNS. · 9d6918d3
      Simon Kelley authored
      dnsmasq allows to specify a interface for each name server passed with
      the -S option or pushed through D-Bus; when an interface is set,
      queries to the server will be forced via that interface.
      
      Currently dnsmasq uses SO_BINDTODEVICE to enforce that traffic goes
      through the given interface; SO_BINDTODEVICE also guarantees that any
      response coming from other interfaces is ignored.
      
      This can cause problems in some scenarios: consider the case where
      eth0 and eth1 are in the same subnet and eth0 has a name server ns0
      associated.  There is no guarantee that the response to a query sent
      via eth0 to ns0 will be received on eth0 because the local router may
      have in the ARP table the MAC address of eth1 for the IP of eth0. This
      can happen because Linux sends ARP responses for all the IPs of the
      machine through all interfaces. The response packet on the wrong
      interface will be dropped because of SO_BINDTODEVICE and the
      resolution will fail.
      
      To avoid this situation, dnsmasq should only restrict queries, but not
      responses, to the given interface. A way to do this on Linux is with
      the IP_UNICAST_IF and IPV6_UNICAST_IF socket options which were added
      in kernel 3.4 and, respectively, glibc versions 2.16 and 2.26.
      Reported-by: default avatarHector Martin <marcan@marcan.st>
      Signed-off-by: default avatarBeniamino Galvani <bgalvani@redhat.com>
      9d6918d3
  6. 11 Oct, 2017 1 commit
  7. 10 Oct, 2017 1 commit
  8. 02 Oct, 2017 1 commit
  9. 30 Sep, 2017 1 commit
  10. 27 Sep, 2017 2 commits
  11. 26 Sep, 2017 10 commits
  12. 25 Sep, 2017 1 commit
  13. 08 Sep, 2017 1 commit
  14. 07 Sep, 2017 1 commit
  15. 09 Jul, 2017 3 commits
  16. 28 Jun, 2017 3 commits
    • Rosen Penev's avatar
      Printf related fixes. · cbd29e5d
      Rosen Penev authored
      cbd29e5d
    • Rosen Penev's avatar
      Fix function declarations. · 50a2841d
      Rosen Penev authored
      50a2841d
    • Hans Dedecker's avatar
      Try other servers if first returns REFUSED when --strict-order active. · 9396752c
      Hans Dedecker authored
      If a DNS server replies REFUSED for a given DNS query in strict order mode
      no failover to the next DNS server is triggered as the failover logic only
      covers non strict mode.
      As a result the client will be returned the REFUSED reply without first
      falling back to the secondary DNS server(s).
      
      Make failover support work as well for strict mode config in case REFUSED is
      replied by deleting the strict order check and rely only on forwardall being
      equal to 0 which is the case in non strict mode when a single server has been
      contacted or when strict order mode has been configured.
      9396752c
  17. 26 Jun, 2017 2 commits