shawn1m / overture

A customized DNS relay server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

linux-mips-softfloat 1.6-rc3版的bug

0x112 opened this issue · comments

我的配置:

{
  "BindAddress": ":1212",
  "DebugHTTPAddress": "127.0.0.1:5555",
  "PrimaryDNS": [
    {
      "Name": "DNSPod",
      "Address": "119.29.29.29:53",
      "Protocol": "udp",
      "SOCKS5Address": "",
      "Timeout": 5,
      "EDNSClientSubnet": {
        "Policy": "manual",
        "ExternalIP": "***.***.***.***",
        "NoCookie": false
      }
    }
  ],
  "AlternativeDNS": [
    {
      "Name": "GoogleDNS",
      "Address": "8.8.8.8:53",
      "Protocol": "udp",
      "SOCKS5Address": "",
      "Timeout": 5,
      "EDNSClientSubnet": {
        "Policy": "manual",
        "ExternalIP": "***.***.***.***",
        "NoCookie": false
      }
    }
  ],
  "OnlyPrimaryDNS": false,
  "IPv6UseAlternativeDNS": false,
  "WhenPrimaryDNSAnswerNoneUse": "AlternativeDNS",
  "IPNetworkFile": {
    "Primary": "/path/to/china_ip_list",
    "Alternative": "/path/to/empty_file"
  },
  "DomainFile": {
    "Primary": "/path/to/china_domain_list",
    "Alternative": "/path/to/gfw_domain_list",
    "Matcher":  "suffix-tree"
  },
  "HostsFile": "/path/to/empty_file",
  "MinimumTTL": 0,
  "DomainTTLFile" : "/path/to/empty_file",
  "CacheSize" : 0,
  "RejectQType": [255]
}

测试:(这个版本测试其它域名正常,linux的amd64版本测试这个域名也正常,应该是linux-mips-softfloat版本的bug了)

C:\Users\Administrator>dig www.xxx.xx @192.168.0.2 -p 1212

; <<>> DiG 9.14.1 <<>> www.xxx.xx @192.168.0.2 -p 1212
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 33045
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;www.xxx.xx.                  IN      A

;; Query time: 37 msec
;; SERVER: 192.168.1.2#1212(192.168.0.2)
;; MSG SIZE  rcvd: 30

得不到结果,出现以下日志

...
DEBU[2019-08-11 16:04:37] Question from 192.168.1.107: ;www.xxx.xx.   IN       A
DEBU[2019-08-11 16:04:37] Domain Primary match fail
DEBU[2019-08-11 16:04:37] Domain Alternative match fail
DEBU[2019-08-11 16:04:37] DNSPod Fail: dns: overflowing header size
DEBU[2019-08-11 16:04:37] Primary DNS return nil, finally use alternative DNS
DEBU[2019-08-11 16:04:37] GoogleDNS Fail: dns: overflowing header size
...
commented

This error is thrown by miekg/dns the dns dependency library of overture. If it is a operating system specific bug, what I can do is very limited.

// truncateMsgFromRdLength truncates msg to match the expected length of the RR.
// Returns an error if msg is smaller than the expected size.
func truncateMsgFromRdlength(msg []byte, off int, rdlength uint16) (truncmsg []byte, err error) {
	lenrd := off + int(rdlength)
	if lenrd > len(msg) {
		return msg, &Error{err: "overflowing header size"}
	}
	return msg[:lenrd], nil
}