File tree 6 files changed +12
-6
lines changed
6 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ GOBIN="go"
44
44
45
45
$GOBIN version
46
46
47
- LDFLAGS=" '-s -w'"
47
+ LDFLAGS=" '-s -w -checklinkname=0 '"
48
48
FAILURES=" "
49
49
ROOT=${PWD}
50
50
OUTPUT=" ${ROOT} /dist/TorrServer"
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
13
13
14
14
"github.com/anacrolix/dms/dlna/dms"
15
15
"github.com/anacrolix/log"
16
+ "github.com/wlynxg/anet"
16
17
17
18
"server/settings"
18
19
"server/web/pages/template"
@@ -26,7 +27,7 @@ func Start() {
26
27
Logger : logger .WithNames ("dms" , "server" ),
27
28
Interfaces : func () (ifs []net.Interface ) {
28
29
var err error
29
- ifaces , err := net .Interfaces ()
30
+ ifaces , err := anet .Interfaces ()
30
31
if err != nil {
31
32
logger .Levelf (log .Error , "%v" , err )
32
33
return
@@ -171,7 +172,7 @@ func getDefaultFriendlyName() string {
171
172
}
172
173
173
174
if host == "localhost" { // useless host, use 1st IP
174
- ifaces , err := net .Interfaces ()
175
+ ifaces , err := anet .Interfaces ()
175
176
if err != nil {
176
177
return ret + ": " + userName + "@" + host
177
178
}
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ require (
23
23
github.com/swaggo/files v1.0.1
24
24
github.com/swaggo/gin-swagger v1.6.0
25
25
github.com/swaggo/swag v1.16.3
26
+ github.com/wlynxg/anet v0.0.5
26
27
go.etcd.io/bbolt v1.3.10
27
28
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc
28
29
golang.org/x/image v0.18.0
Original file line number Diff line number Diff line change @@ -338,6 +338,8 @@ github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65E
338
338
github.com/ugorji/go/codec v1.2.12 /go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg =
339
339
github.com/willf/bitset v1.1.9 /go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4 =
340
340
github.com/willf/bitset v1.1.10 /go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4 =
341
+ github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU =
342
+ github.com/wlynxg/anet v0.0.5 /go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA =
341
343
github.com/yuin/goldmark v1.4.1 /go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k =
342
344
github.com/yuin/goldmark v1.4.13 /go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY =
343
345
go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0 =
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
10
10
"github.com/anacrolix/publicip"
11
11
"github.com/anacrolix/torrent"
12
12
"github.com/anacrolix/torrent/metainfo"
13
+ "github.com/wlynxg/anet"
13
14
14
15
"server/settings"
15
16
"server/torr/storage/torrstor"
@@ -207,7 +208,7 @@ func isPrivateIP(ip net.IP) bool {
207
208
}
208
209
209
210
func getPublicIp4 () net.IP {
210
- ifaces , err := net .Interfaces ()
211
+ ifaces , err := anet .Interfaces ()
211
212
if err != nil {
212
213
log .Println ("Error get public IPv4" )
213
214
return nil
@@ -233,7 +234,7 @@ func getPublicIp4() net.IP {
233
234
}
234
235
235
236
func getPublicIp6 () net.IP {
236
- ifaces , err := net .Interfaces ()
237
+ ifaces , err := anet .Interfaces ()
237
238
if err != nil {
238
239
log .Println ("Error get public IPv6" )
239
240
return nil
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
10
10
"github.com/gin-contrib/cors"
11
11
"github.com/gin-contrib/location"
12
12
"github.com/gin-gonic/gin"
13
+ "github.com/wlynxg/anet"
13
14
14
15
"server/dlna"
15
16
"server/settings"
@@ -139,7 +140,7 @@ func echo(c *gin.Context) {
139
140
}
140
141
141
142
func getLocalIps () []string {
142
- ifaces , err := net .Interfaces ()
143
+ ifaces , err := anet .Interfaces ()
143
144
if err != nil {
144
145
log .TLogln ("Error get local IPs" )
145
146
return nil
You can’t perform that action at this time.
0 commit comments