ODoH: supoprt config version 0x0001 in addition to 0xff06

This commit is contained in:
Frank Denis 2021-06-11 21:17:48 +02:00
parent a34258c3aa
commit 1b03ac817e
1 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,8 @@ import (
)
const (
odohVersion = uint16(0xff06)
odohVersion = uint16(0x0001)
odohTestVersion = uint16(0xff06)
maxODoHConfigs = 10
)
@ -77,7 +78,7 @@ func parseODoHTargetConfigs(configs []byte) ([]ODoHTargetConfig, error) {
}
configVersion := binary.BigEndian.Uint16(configs[offset : offset+2])
configLength := binary.BigEndian.Uint16(configs[offset+2 : offset+4])
if configVersion == odohVersion {
if configVersion == odohVersion || configVersion == odohTestVersion {
target, err := parseODoHTargetConfig(configs[offset+4 : offset+4+int(configLength)])
if err == nil {
targets = append(targets, target)