Skip to content

Commit a60ed1d

Browse files
rg0nowstv0g
authored andcommitted
Fix PermissionHandler test failure, fix #293
Modify the PermissionHandler test client to bind to the default localhost IPv4 address, 127.0.0.1, instead of 127.0.0.33 that may not be up by default on certain platforms. The client IP 127.0.0.33 was chosen originally to minimize interference with existing tests.
1 parent e3ad12c commit a60ed1d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func TestServer(t *testing.T) {
133133
Address: "0.0.0.0",
134134
},
135135
PermissionHandler: func(src net.Addr, peer net.IP) bool {
136-
return src.String() == "127.0.0.33:54321" &&
136+
return src.String() == "127.0.0.1:54321" &&
137137
peer.Equal(net.ParseIP("127.0.0.4"))
138138
},
139139
},
@@ -144,7 +144,7 @@ func TestServer(t *testing.T) {
144144
assert.NoError(t, err)
145145

146146
// enforce corrent client IP and port
147-
conn, err := net.ListenPacket("udp4", "127.0.0.33:54321")
147+
conn, err := net.ListenPacket("udp4", "127.0.0.1:54321")
148148
assert.NoError(t, err)
149149

150150
client, err := NewClient(&ClientConfig{

0 commit comments

Comments
 (0)