Skip to content

Commit 1410732

Browse files
icmp: align ping/fping behavior
bind: optimize
1 parent 2b9aa78 commit 1410732

File tree

9 files changed

+155
-110
lines changed

9 files changed

+155
-110
lines changed

bind/bind.go

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,32 @@ func Parse(ips []string) error {
8888
return nil
8989
}
9090

91-
func LAddr4() *net.IPAddr {
92-
return v4
91+
type IPAddr struct {
92+
I *net.IPAddr
9393
}
9494

95-
func LAddr6() *net.IPAddr {
96-
return v6
95+
func (a IPAddr) String() string {
96+
if a.I == nil {
97+
return ""
98+
}
99+
100+
return a.I.String()
101+
}
102+
103+
func (a IPAddr) AsTCP() *net.TCPAddr {
104+
if a.I == nil {
105+
return nil
106+
}
107+
108+
return &net.TCPAddr{IP: a.I.IP, Zone: a.I.Zone}
109+
}
110+
111+
func LAddr4() IPAddr {
112+
return IPAddr{I: v4}
113+
}
114+
115+
func LAddr6() IPAddr {
116+
return IPAddr{I: v6}
97117
}
98118

99119
func Set() bool {

release/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
ver = subprocess.run("git describe --tags", shell=True, capture_output=True)
77
ver = ver.stdout.decode().strip()
88

9-
full_ver = subprocess.run("git describe --always --dirty --long --tags", shell=True, capture_output=True)
9+
full_ver = subprocess.run("git describe --always --dirty --tags", shell=True, capture_output=True)
1010
full_ver = full_ver.stdout.decode().strip()
1111

1212
cur = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')

0 commit comments

Comments
 (0)