File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
- package multiaddr
1
+ package filter
2
2
3
3
import (
4
4
"net"
5
5
"sync"
6
+
7
+ ma "github.com/multiformats/go-multiaddr"
6
8
)
7
9
8
10
// Action is an enum modelling all possible filter actions.
@@ -108,17 +110,17 @@ func (fs *Filters) RemoveLiteral(ipnet net.IPNet) (removed bool) {
108
110
// TODO: currently, the last filter to match wins always, but it shouldn't be that way.
109
111
// Instead, the highest-specific last filter should win; that way more specific filters
110
112
// override more general ones.
111
- func (fs * Filters ) AddrBlocked (a Multiaddr ) (deny bool ) {
113
+ func (fs * Filters ) AddrBlocked (a ma. Multiaddr ) (deny bool ) {
112
114
var (
113
115
netip net.IP
114
116
found bool
115
117
)
116
118
117
- ForEach (a , func (c Component ) bool {
119
+ ma . ForEach (a , func (c ma. Component ) bool {
118
120
switch c .Protocol ().Code {
119
- case P_IP6ZONE :
121
+ case ma . P_IP6ZONE :
120
122
return true
121
- case P_IP6 , P_IP4 :
123
+ case ma . P_IP6 , ma . P_IP4 :
122
124
found = true
123
125
netip = net .IP (c .RawValue ())
124
126
return false
Original file line number Diff line number Diff line change 1
- package multiaddr
1
+ package filter
2
2
3
3
import (
4
4
"net"
@@ -66,7 +66,7 @@ func TestFilterBlocking(t *testing.T) {
66
66
"/ip6/fd00::2/tcp/321" ,
67
67
"/ip6/fc00::1/udp/321" ,
68
68
} {
69
- maddr , err := NewMultiaddr (blocked )
69
+ maddr , err := ma . NewMultiaddr (blocked )
70
70
if err != nil {
71
71
t .Error (err )
72
72
}
You can’t perform that action at this time.
0 commit comments