Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-netroute
Commits
3c588937
Unverified
Commit
3c588937
authored
Mar 08, 2020
by
Will Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diagnostics
parent
cb7084c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
netroute_test.go
netroute_test.go
+4
-1
No files found.
netroute_test.go
View file @
3c588937
package
netroute
import
(
"fmt"
"net"
"strings"
"testing"
...
...
@@ -29,7 +30,8 @@ func TestRoute(t *testing.T) {
for
_
,
addr
:=
range
addrs
{
if
strings
.
HasPrefix
(
addr
.
Network
(),
"ip"
)
{
_
,
ipn
,
_
:=
net
.
ParseCIDR
(
addr
.
String
())
if
ipn
.
IP
.
To4
()
==
nil
{
if
ipn
.
IP
.
To4
()
==
nil
||
!
ipn
.
IP
.
IsInterfaceLocalMulticast
()
{
fmt
.
Printf
(
"See IPv6 Interface: %v
\n
"
,
addr
)
hasV6
=
true
break
}
...
...
@@ -41,6 +43,7 @@ func TestRoute(t *testing.T) {
t
.
Fatal
(
err
)
}
if
gw
!=
nil
||
!
src
.
Equal
(
localAddr
)
{
fmt
.
Printf
(
"when routing to %v, saw %v
\n
"
,
localAddr
,
src
)
t
.
Fatalf
(
"Did not expect gateway to localhost: %v"
,
gw
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment