From 88a2d13a8f89f1cbe45aa5b3fe38f24c910a4182 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sat, 26 May 2012 14:56:23 +0200 Subject: [PATCH] Remove NewUpdate, we already have the simpler SetUpdate --- defaults.go | 2 ++ update.go | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/defaults.go b/defaults.go index a12cb198..7d5c5e85 100644 --- a/defaults.go +++ b/defaults.go @@ -55,7 +55,9 @@ func (dns *Msg) SetRcodeFormatError(request *Msg) { // sets the ZONE section to: z, TypeSOA, classINET. func (dns *Msg) SetUpdate(z string) { dns.MsgHdr.Id = Id() + dns.MsgHdr.Response = false dns.MsgHdr.Opcode = OpcodeUpdate + dns.Compress = false // BIND9 cannot handle compression dns.Question = make([]Question, 1) dns.Question[0] = Question{z, TypeSOA, ClassINET} } diff --git a/update.go b/update.go index 0edeee9e..93de460a 100644 --- a/update.go +++ b/update.go @@ -35,18 +35,6 @@ // package dns -// NewUpdate creates a new DNS update packet. This returns a normal -// dns *Msg, but sets some options. -func NewUpdate(zone string, class uint16) *Msg { - u := new(Msg) - u.MsgHdr.Response = false - u.MsgHdr.Opcode = OpcodeUpdate - u.Compress = false // Seems BIND9 at least cannot handle compressed update pkgs - u.Question = make([]Question, 1) - u.Question[0] = Question{zone, TypeSOA, class} - return u -} - // The table from RFC 2136 supplemented with the Go DNS function. // // 3.2.4 - Table Of Metavalues Used In Prerequisite Section