Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid matching IPs in parts of URL #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

outloudvi
Copy link

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