Skip to content

Conversation

SamTherapy
Copy link
Contributor

Adds to opt.String() making the opt printing more like dig.

The &0x7FFF is like dig, which doesn't display the DO flag even when set (see below)

❯ dig +ednsflags=12 +expire github.com +qr +dnssec

; <<>> DiG 9.18.4-2-Debian <<>> +ednsflags +expire github.com +qr +dnssec
;; global options: +cmd
;; Sending:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56825
;; flags: rd ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; MBZ: 0x000c, udp: 1232
; COOKIE: 
; EXPIRE:
;; QUESTION SECTION:
;github.com.                    IN      A

;; QUERY SIZE: 55

Signed-off-by: Sam Therapy <sam@samtherapy.net>
@SamTherapy SamTherapy requested review from miekg and tmthrgd as code owners July 30, 2022 13:48
Signed-off-by: Sam Therapy <sam@samtherapy.net>
@SamTherapy SamTherapy requested review from tmthrgd and removed request for miekg September 3, 2022 13:01
@miekg miekg merged commit caa3fe0 into miekg:master Jan 5, 2023
@SamTherapy SamTherapy deleted the dig-edns-printing branch January 5, 2023 14:47
monoidic added a commit to monoidic/dns that referenced this pull request Feb 18, 2023
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.

3 participants