Skip to content

Commit

Permalink
lib/dns: fix unpacking ipv4hint on SVCB record
Browse files Browse the repository at this point in the history
Somehow the test passed on my main machine, but failed on my laptop.
Weird.
  • Loading branch information
shuLhan committed Apr 2, 2024
1 parent f21ec39 commit 8118f95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dns/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,7 @@ func TestUnpackMessage_SVCB(t *testing.T) {

msg, err = UnpackMessage(stream)
if err != nil {
t.Fatal(logp, err)
t.Fatal(logp, name, err)
}

stream, err = json.MarshalIndent(&msg, ``, ` `)
Expand Down
1 change: 1 addition & 0 deletions lib/dns/rdata_svcb.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ func (svcb *RDataSVCB) unpackParamIpv4hint(packet []byte) ([]byte, error) {
var ip = net.IP(packet[0:4])
packet = packet[4:]
listValue = append(listValue, ip.String())
n--
}

svcb.Params[svcbKeyIDIpv4hint] = listValue
Expand Down
3 changes: 3 additions & 0 deletions lib/dns/testdata/message/UnpackMessage_SVCB_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ The test input taken from output of parsing SVCB record from zone file.
"1": [
"h2",
"h3-19"
],
"4": [
"192.0.2.1"
]
},
"TargetName": "foo.example.org",
Expand Down

0 comments on commit 8118f95

Please sign in to comment.