Tcl Library Source Code

Ticket Change Details
Login
Overview

Artifact ID: 422856ffc21b618d2fe020948212852d9ce2186a3cdd4501a8218f7f721c8fe3
Ticket: 8168daf796e4cc2a843f4d1a4f2f38e348197945
make reverse lookup of IPv6 addresses work
User & Date: buzzdeee 2019-06-13 10:53:11
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/html"
  4. comment changed to:
    using <pre>[dns::resolve AN_IPv6_ADDRESS]</pre> currently leads to an error.<br>
    
    this patch against modules/dns/dns.tcl below makes it work for me:
    
    <pre>
    --- dns.tcl.orig	Thu Jun 13 12:34:10 2019
    +++ dns.tcl	Thu Jun 13 12:38:02 2019
    @@ -286,10 +286,17 @@
             }
         }
     
    -    # Check for reverse lookups
    +    # Check for reverse lookups, IPv4 first, then IPv6
         if {[regexp {^(?:\d{0,3}\.){3}\d{0,3}$} $state(query)]} {
             set addr [lreverse [split $state(query) .]]
             lappend addr in-addr arpa
    +        set state(query) [join $addr .]
    +        set state(-type) PTR
    +    } elseif {[string match {*:*} $state(query)]} {
    +        set addr [ip::normalize $state(query)]
    +        set addr [split [string reverse $addr] :]
    +        set addr [join [split [join $addr ""] {}] .]
    +        lappend addr ip6 arpa
             set state(query) [join $addr .]
             set state(-type) PTR
         }
    
    </pre>
    
    similarily to checking if we got an IPv4 address, check if the query contains a colon. Checking if it contains a colon should be sufficient, since IPv4 addresses don't contain colons, as well as they are not allowed in hostnames.
    
    Once an IPv6 address is identified, normalize it, and format the query appropriately.
    
  5. foundin changed to: "1.19"
  6. is_private changed to: "0"
  7. login: "buzzdeee"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "buzzdeee"
  13. subsystem changed to: "dns"
  14. title changed to: "make reverse lookup of IPv6 addresses work"
  15. type changed to: "RFE"