Show ip6 address with [ and ]
This commit is contained in:
parent
c326309d62
commit
77709d301c
12
edns.go
12
edns.go
|
@ -221,8 +221,12 @@ func (e *EDNS0_SUBNET) Unpack(b []byte) {
|
|||
return
|
||||
}
|
||||
|
||||
func (e *EDNS0_SUBNET) String() string {
|
||||
return e.Address.String() + "/" +
|
||||
strconv.Itoa(int(e.SourceNetmask)) + "/" +
|
||||
strconv.Itoa(int(e.SourceScope))
|
||||
func (e *EDNS0_SUBNET) String() (s string) {
|
||||
if e.Address.To4() != nil {
|
||||
s = e.Address.String()
|
||||
} else {
|
||||
s = "[" + e.Address.String() + "]"
|
||||
}
|
||||
s += "/" + strconv.Itoa(int(e.SourceNetmask)) + "/" + strconv.Itoa(int(e.SourceScope))
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue