Skip to content

fix: avoid matching IPs in parts of URL#7

Open
outloudvi wants to merge 1 commit into
SukkaW:masterfrom
outloudvi:patch-1
Open

fix: avoid matching IPs in parts of URL#7
outloudvi wants to merge 1 commit into
SukkaW:masterfrom
outloudvi:patch-1

Conversation

@outloudvi
Copy link
Copy Markdown

In some cases we don't really want to check an IP-like addresses (for example, when we are doing RDNS queries). This PR checks if the IP address is not part of a longer string, and discards it if it is.

; <<>> DiG 9.16.7 <<>> -x 1.2.4.8 [中国 CNNIC 权威云解析 (CDNS.CN) 全球 Anycast 节点]
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38009
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;8.4.2.1 [美国 科罗拉多州布隆菲尔德市 Level 3 通信股份有限公司].in-addr.arpa.		IN	PTR

;; ANSWER SECTION:
8.4.2.1 [美国 科罗拉多州布隆菲尔德市 Level 3 通信股份有限公司].in-addr.arpa.	21599	IN	PTR	public1.sdns.cn.

;; Query time: 118 msec
;; SERVER: 127.0.0.1 [局域网 IP]#53(127.0.0.1 [局域网 IP])
;; WHEN: Tue Oct 20 09:34:12 CST 2020
;; MSG SIZE  rcvd: 78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant