Fix tests and tsig in the process

This commit is contained in:
Miek Gieben 2012-10-09 22:45:19 +02:00
parent 19470ba22d
commit 10a349423c
3 changed files with 3 additions and 2 deletions

View File

@ -61,7 +61,7 @@ func TestClientTsigAXFR(t *testing.T) {
c.Net = "tcp"
if a, err := c.XfrReceive(m, "85.223.71.124:53"); err != nil {
t.Log("Failed to setup axfr" + err.Error())
t.Log("Failed to setup axfr: " + err.Error())
t.Fail()
return
} else {

View File

@ -194,7 +194,7 @@ func TsigGenerate(m *Msg, secret, requestMAC string, timersOnly bool) ([]byte, s
t.OrigId = m.Id
tbuf := make([]byte, t.Len())
if off, err := PackRR(t, tbuf, 0, nil, false); err != nil {
if off, err := PackRR(t, tbuf, 0, nil, false); err == nil {
tbuf = tbuf[:off] // reset to actual size used
} else {
return nil, "", err

View File

@ -109,6 +109,7 @@ func NewZoneData(s string) *ZoneData {
// we preserve the nsec ordering of the zone (this idea was stolen from NSD).
// Each label is also lowercased.
func toRadixName(d string) string {
// FIXME(mg): make *much* faster
if d == "." {
return "."
}