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
ec875c94
Unverified
Commit
ec875c94
authored
Mar 30, 2020
by
Will Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove full iface access assumption
linux/bsd fix #8
parent
bca610e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
9 deletions
+2
-9
netroute_bsd.go
netroute_bsd.go
+1
-4
netroute_linux.go
netroute_linux.go
+1
-5
No files found.
netroute_bsd.go
View file @
ec875c94
...
...
@@ -124,10 +124,7 @@ func New() (routing.Router, error) {
if
err
!=
nil
{
return
nil
,
err
}
for
i
,
iface
:=
range
ifaces
{
if
i
!=
iface
.
Index
-
1
{
return
nil
,
fmt
.
Errorf
(
"out of order iface %d = %v"
,
i
,
iface
)
}
for
_
,
iface
:=
range
ifaces
{
rtr
.
ifaces
=
append
(
rtr
.
ifaces
,
iface
)
var
addrs
ipAddrs
ifaceAddrs
,
err
:=
iface
.
Addrs
()
...
...
netroute_linux.go
View file @
ec875c94
...
...
@@ -12,7 +12,6 @@
package
netroute
import
(
"fmt"
"net"
"sort"
"syscall"
...
...
@@ -83,10 +82,7 @@ loop:
if
err
!=
nil
{
return
nil
,
err
}
for
i
,
iface
:=
range
ifaces
{
if
i
!=
iface
.
Index
-
1
{
return
nil
,
fmt
.
Errorf
(
"out of order iface %d = %v"
,
i
,
iface
)
}
for
_
,
iface
:=
range
ifaces
{
rtr
.
ifaces
=
append
(
rtr
.
ifaces
,
iface
)
var
addrs
ipAddrs
ifaceAddrs
,
err
:=
iface
.
Addrs
()
...
...
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