Fix the CAA type
This commit is contained in:
parent
4e6b3a5afc
commit
67065da09c
2
msg.go
2
msg.go
|
@ -756,7 +756,7 @@ func unpackStructValue(val reflect.Value, msg []byte, off int) (off1 int, err er
|
|||
break
|
||||
}
|
||||
l := int(msg[off])
|
||||
if off+l+1 > lenmsg {
|
||||
if off+l+1 > lenmsg { // TODO(miek): +1 or ... not ...
|
||||
return lenmsg, &Error{err: "overflow unpacking txt"}
|
||||
}
|
||||
txt = append(txt, string(msg[off+1:off+l+1]))
|
||||
|
|
14
types.go
14
types.go
|
@ -1385,7 +1385,7 @@ type CAA struct {
|
|||
Hdr RR_Header
|
||||
Flag uint8
|
||||
Tag string
|
||||
Value []string `dns:"txt"`
|
||||
Value string `dns:"octet"`
|
||||
}
|
||||
|
||||
func (rr *CAA) Header() *RR_Header { return &rr.Hdr }
|
||||
|
@ -1393,21 +1393,13 @@ func (rr *CAA) copy() RR { return &CAA{*rr.Hdr.copyHeader(), rr.Flag,
|
|||
|
||||
func (rr *CAA) String() string {
|
||||
s := rr.Hdr.String() + strconv.FormatInt(int64(rr.Flag), 10) + " " + rr.Tag
|
||||
for i, s1 := range rr.Value {
|
||||
if i > 0 {
|
||||
s += " " + strconv.QuoteToASCII(s1)
|
||||
} else {
|
||||
s += strconv.QuoteToASCII(s1)
|
||||
}
|
||||
}
|
||||
s += strconv.QuoteToASCII(rr.Value)
|
||||
return s
|
||||
}
|
||||
|
||||
func (rr *CAA) len() int {
|
||||
l := rr.Hdr.len() + 1 + len(rr.Tag)
|
||||
for _, t := range rr.Value {
|
||||
l += len(t)
|
||||
}
|
||||
l += len(rr.Value)
|
||||
return l
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue