Fix very large SOA/TTL values
This commit is contained in:
parent
3f5f2ed026
commit
9c5c2ee96f
2
dns.go
2
dns.go
|
@ -149,7 +149,7 @@ func (h *RR_Header) String() string {
|
|||
} else {
|
||||
s += h.Name + "\t"
|
||||
}
|
||||
s = s + strconv.Itoa(int(h.Ttl)) + "\t"
|
||||
s = s + strconv.FormatInt(int64(h.Ttl), 10) + "\t"
|
||||
|
||||
if _, ok := Class_str[h.Class]; ok {
|
||||
s += Class_str[h.Class] + "\t"
|
||||
|
|
|
@ -421,3 +421,11 @@ b1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
|
|||
fmt.Printf("%s\n", hip.String())
|
||||
}
|
||||
}
|
||||
|
||||
// example.com. 1000 IN SOA master.example.com. admin.example.com. 1 4294967294 4294967293 4294967295 100
|
||||
func ExampleSOA() {
|
||||
s := "example.com. 1000 SOA master.example.com. admin.example.com. 1 4294967294 4294967293 4294967295 100"
|
||||
if soa, err := NewRR(s); err == nil {
|
||||
fmt.Printf("%s\n", soa.String())
|
||||
}
|
||||
}
|
||||
|
|
12
types.go
12
types.go
|
@ -359,11 +359,11 @@ func (rr *RR_SOA) Header() *RR_Header {
|
|||
|
||||
func (rr *RR_SOA) String() string {
|
||||
return rr.Hdr.String() + rr.Ns + " " + rr.Mbox +
|
||||
" " + strconv.Itoa(int(rr.Serial)) +
|
||||
" " + strconv.Itoa(int(rr.Refresh)) +
|
||||
" " + strconv.Itoa(int(rr.Retry)) +
|
||||
" " + strconv.Itoa(int(rr.Expire)) +
|
||||
" " + strconv.Itoa(int(rr.Minttl))
|
||||
" " + strconv.FormatInt(int64(rr.Serial), 10) +
|
||||
" " + strconv.FormatInt(int64(rr.Refresh), 10) +
|
||||
" " + strconv.FormatInt(int64(rr.Retry), 10) +
|
||||
" " + strconv.FormatInt(int64(rr.Expire), 10) +
|
||||
" " + strconv.FormatInt(int64(rr.Minttl), 10)
|
||||
}
|
||||
|
||||
func (rr *RR_SOA) Len() int {
|
||||
|
@ -605,7 +605,7 @@ func (rr *RR_RRSIG) String() string {
|
|||
return rr.Hdr.String() + Rr_str[rr.TypeCovered] +
|
||||
" " + strconv.Itoa(int(rr.Algorithm)) +
|
||||
" " + strconv.Itoa(int(rr.Labels)) +
|
||||
" " + strconv.Itoa(int(rr.OrigTtl)) +
|
||||
" " + strconv.FormatInt(int64(rr.OrigTtl), 10) +
|
||||
" " + timeToDate(rr.Expiration) +
|
||||
" " + timeToDate(rr.Inception) +
|
||||
" " + strconv.Itoa(int(rr.KeyTag)) +
|
||||
|
|
Loading…
Reference in New Issue