This commit is contained in:
Miek Gieben 2012-12-09 19:07:31 +01:00
parent ff22456520
commit 3609f3e7a5
3 changed files with 8 additions and 8 deletions

View File

@ -70,9 +70,9 @@ func (w *reply) dial() (err error) {
}
for a := 0; a < attempts; a++ {
if w.client.Net == "" {
conn, err = net.DialTimeout("udp", w.addr, 5 * 1e9)
conn, err = net.DialTimeout("udp", w.addr, 5*1e9)
} else {
conn, err = net.DialTimeout(w.client.Net, w.addr, 5 * 1e9)
conn, err = net.DialTimeout(w.client.Net, w.addr, 5*1e9)
}
if err == nil {
break

4
msg.go
View File

@ -306,7 +306,7 @@ func PackDomainName(s string, msg []byte, off int, compression map[string]int, c
msg[off] = 0
End:
off++
if off - offstart > 255 {
if off-offstart > 255 {
return lenmsg, ErrDomain
}
return off, nil
@ -392,7 +392,7 @@ Loop:
if ptr == 0 {
off1 = off
}
if off1 - offstart > 255 {
if off1-offstart > 255 {
return "", lenmsg, ErrDomain
}
return s, off1, nil

View File

@ -339,12 +339,12 @@ func (z *Zone) RemoveRRset(s string, t uint16) error {
switch t {
case TypeRRSIG:
// empty all signature maps
for covert, _ := range zd.Value.(*ZoneData).Signatures {
for covert := range zd.Value.(*ZoneData).Signatures {
delete(zd.Value.(*ZoneData).Signatures, covert)
}
default:
// empty all rr maps
for t, _ := range zd.Value.(*ZoneData).RR {
for t := range zd.Value.(*ZoneData).RR {
delete(zd.Value.(*ZoneData).RR, t)
}
}
@ -428,7 +428,7 @@ func (z *Zone) Sign(keys map[*RR_DNSKEY]PrivateKey, config *SignatureConfig) err
}
// Pre-calc the key tag
keytags := make(map[*RR_DNSKEY]uint16)
for k, _ := range keys {
for k := range keys {
keytags[k] = k.KeyTag()
}
@ -507,7 +507,7 @@ func (node *ZoneData) Sign(next *ZoneData, keys map[*RR_DNSKEY]PrivateKey, keyta
// Still need to add NSEC + RRSIG for this data, there might also be a DS record
if node.NonAuth == true {
for t, _ := range node.RR {
for t := range node.RR {
nsec.TypeBitMap = append(nsec.TypeBitMap, t)
}
nsec.TypeBitMap = append(nsec.TypeBitMap, TypeRRSIG) // Add sig too