gofmt
This commit is contained in:
parent
e747b8f46e
commit
de95ac0bb3
|
@ -57,7 +57,7 @@ func (dns *Msg) SetUpdate(z string) {
|
||||||
dns.MsgHdr.Id = Id()
|
dns.MsgHdr.Id = Id()
|
||||||
dns.MsgHdr.Response = false
|
dns.MsgHdr.Response = false
|
||||||
dns.MsgHdr.Opcode = OpcodeUpdate
|
dns.MsgHdr.Opcode = OpcodeUpdate
|
||||||
dns.Compress = false // BIND9 cannot handle compression
|
dns.Compress = false // BIND9 cannot handle compression
|
||||||
dns.Question = make([]Question, 1)
|
dns.Question = make([]Question, 1)
|
||||||
dns.Question[0] = Question{z, TypeSOA, ClassINET}
|
dns.Question[0] = Question{z, TypeSOA, ClassINET}
|
||||||
}
|
}
|
||||||
|
|
8
edns.go
8
edns.go
|
@ -197,11 +197,11 @@ func (e *EDNS0_SUBNET) Pack() ([]byte, error) {
|
||||||
b[3] = e.SourceScope
|
b[3] = e.SourceScope
|
||||||
switch e.Family {
|
switch e.Family {
|
||||||
case 1:
|
case 1:
|
||||||
if e.SourceNetmask > net.IPv4len * 8 {
|
if e.SourceNetmask > net.IPv4len*8 {
|
||||||
return nil, errors.New("bad netmask")
|
return nil, errors.New("bad netmask")
|
||||||
}
|
}
|
||||||
ip := make([]byte, net.IPv4len)
|
ip := make([]byte, net.IPv4len)
|
||||||
a := e.Address.To4().Mask( net.CIDRMask(int(e.SourceNetmask), net.IPv4len * 8) )
|
a := e.Address.To4().Mask(net.CIDRMask(int(e.SourceNetmask), net.IPv4len*8))
|
||||||
for i := 0; i < net.IPv4len; i++ {
|
for i := 0; i < net.IPv4len; i++ {
|
||||||
if i+1 > len(e.Address) {
|
if i+1 > len(e.Address) {
|
||||||
break
|
break
|
||||||
|
@ -210,11 +210,11 @@ func (e *EDNS0_SUBNET) Pack() ([]byte, error) {
|
||||||
}
|
}
|
||||||
b = append(b, ip...)
|
b = append(b, ip...)
|
||||||
case 2:
|
case 2:
|
||||||
if e.SourceNetmask > net.IPv6len * 8 {
|
if e.SourceNetmask > net.IPv6len*8 {
|
||||||
return nil, errors.New("bad netmask")
|
return nil, errors.New("bad netmask")
|
||||||
}
|
}
|
||||||
ip := make([]byte, net.IPv6len)
|
ip := make([]byte, net.IPv6len)
|
||||||
a := e.Address.Mask( net.CIDRMask(int(e.SourceNetmask), net.IPv6len * 8) )
|
a := e.Address.Mask(net.CIDRMask(int(e.SourceNetmask), net.IPv6len*8))
|
||||||
for i := 0; i < net.IPv6len; i++ {
|
for i := 0; i < net.IPv6len; i++ {
|
||||||
if i+1 > len(e.Address) {
|
if i+1 > len(e.Address) {
|
||||||
break
|
break
|
||||||
|
|
2
msg.go
2
msg.go
|
@ -80,7 +80,7 @@ type MsgHdr struct {
|
||||||
type Msg struct {
|
type Msg struct {
|
||||||
MsgHdr
|
MsgHdr
|
||||||
Compress bool // If true, the message will be compressed when converted to wire format.
|
Compress bool // If true, the message will be compressed when converted to wire format.
|
||||||
Size int // Number of octects in the message received from the wire.
|
Size int // Number of octects in the message received from the wire.
|
||||||
RemoteAddr net.Addr // The remote address. Either the server or the client connecting.
|
RemoteAddr net.Addr // The remote address. Either the server or the client connecting.
|
||||||
Question []Question // Holds the RR(s) of the question section.
|
Question []Question // Holds the RR(s) of the question section.
|
||||||
Answer []RR // Holds the RR(s) of the answer section.
|
Answer []RR // Holds the RR(s) of the answer section.
|
||||||
|
|
6
types.go
6
types.go
|
@ -346,9 +346,9 @@ func (rr *RR_MX) Len() int {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RR_AFSDB struct {
|
type RR_AFSDB struct {
|
||||||
Hdr RR_Header
|
Hdr RR_Header
|
||||||
Subtype uint16
|
Subtype uint16
|
||||||
Hostname string `dns:"cdomain-name"`
|
Hostname string `dns:"cdomain-name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rr *RR_AFSDB) Header() *RR_Header {
|
func (rr *RR_AFSDB) Header() *RR_Header {
|
||||||
|
|
Loading…
Reference in New Issue