1
0
mirror of https://github.com/golang/go synced 2024-11-17 02:14:42 -07:00

net: Correct the code snippet erroneously rolled back in CL550435

In CL https://golang.org/cl/550435, a segment that had already been reviewed and modified was rolled back due to an erroneous operation. Here, submit a correct code snippet.

Change-Id: I46adfad110d532aec5f557c350fe6dccbc583968
Reviewed-on: https://go-review.googlesource.com/c/go/+/565628
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Mateusz Poliwczak <mpoliwczak34@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
kkhaike 2024-02-21 21:40:02 +08:00 committed by Gopher Robot
parent 296d0812b0
commit 347ad523e8

View File

@ -270,10 +270,10 @@ func extractExtendedRCode(p dnsmessage.Parser, hdr dnsmessage.Header) (dnsmessag
hasAdd := false
for {
ahdr, err := p.AdditionalHeader()
hasAdd = hasAdd || err != dnsmessage.ErrSectionDone
if err != nil {
return hdr.RCode, hasAdd
}
hasAdd = true
if ahdr.Type == dnsmessage.TypeOPT {
return ahdr.ExtendedRCode(hdr.RCode), hasAdd
}