diff options
| author | Shulhan <ms@kilabit.info> | 2024-04-03 02:12:07 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-04-03 02:12:58 +0700 |
| commit | 8118f95cbbc91c43c786ac239303d42cbb0b3769 (patch) | |
| tree | 2735cf5a8b5033febef6669453701e28a0bf7707 /lib/dns | |
| parent | f21ec39131b5fdaf5d9ff5e2921b6b2cf368f1e0 (diff) | |
| download | pakakeh.go-8118f95cbbc91c43c786ac239303d42cbb0b3769.tar.xz | |
lib/dns: fix unpacking ipv4hint on SVCB record
Somehow the test passed on my main machine, but failed on my laptop.
Weird.
Diffstat (limited to 'lib/dns')
| -rw-r--r-- | lib/dns/message_test.go | 2 | ||||
| -rw-r--r-- | lib/dns/rdata_svcb.go | 1 | ||||
| -rw-r--r-- | lib/dns/testdata/message/UnpackMessage_SVCB_test.txt | 3 |
3 files changed, 5 insertions, 1 deletions
diff --git a/lib/dns/message_test.go b/lib/dns/message_test.go index 5c6fc451..bd8ead34 100644 --- a/lib/dns/message_test.go +++ b/lib/dns/message_test.go @@ -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, ``, ` `) diff --git a/lib/dns/rdata_svcb.go b/lib/dns/rdata_svcb.go index e97eb078..474c7185 100644 --- a/lib/dns/rdata_svcb.go +++ b/lib/dns/rdata_svcb.go @@ -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 diff --git a/lib/dns/testdata/message/UnpackMessage_SVCB_test.txt b/lib/dns/testdata/message/UnpackMessage_SVCB_test.txt index e3237f7a..8454905f 100644 --- a/lib/dns/testdata/message/UnpackMessage_SVCB_test.txt +++ b/lib/dns/testdata/message/UnpackMessage_SVCB_test.txt @@ -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", |
