Skip to content

Commit

Permalink
Merge pull request #55 from akiym/fix-dns-0x20
Browse files Browse the repository at this point in the history
workaround for dns-0x20 again
  • Loading branch information
gdncc authored Dec 4, 2024
2 parents 1c17059 + baeacd9 commit 863b4f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions singularity.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ type DNSQuery struct {
func NewDNSQuery(qname string) (*DNSQuery, error) {
name := new(DNSQuery)

qname = strings.ToLower(qname) // DNS-0x20 work-around

qname = strings.Replace(qname, "--", "_", -1)

split := strings.Split(qname, "-e.")
Expand Down Expand Up @@ -292,7 +290,9 @@ func MakeRebindDNSHandler(appConfig *AppConfig, dcss *DNSClientStateStore) dns.H
case dns.TypeA:
log.Printf("DNS: Received A query: %v from: %v\n", q.Name, w.RemoteAddr().String())

if !strings.HasPrefix(q.Name, "s-") {
qnameLower := strings.ToLower(q.Name)

if !strings.HasPrefix(qnameLower, "s-") {

// Handling query with potential QNAME minimization

Expand Down Expand Up @@ -320,7 +320,7 @@ func MakeRebindDNSHandler(appConfig *AppConfig, dcss *DNSClientStateStore) dns.H
clientState.ResponseReboundIPAddrtimeOut = appConfig.ResponseReboundIPAddrtimeOut

var err error
name, err = NewDNSQuery(q.Name)
name, err = NewDNSQuery(qnameLower)

if err != nil {
log.Printf("DNS: Parsing of query failed: %v, with error: %v\n", name, err)
Expand Down

0 comments on commit 863b4f7

Please sign in to comment.