File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1- package multiaddr
1+ package filter
22
33import (
44 "net"
55 "sync"
6+
7+ ma "github.com/multiformats/go-multiaddr"
68)
79
810// Action is an enum modelling all possible filter actions.
@@ -108,17 +110,17 @@ func (fs *Filters) RemoveLiteral(ipnet net.IPNet) (removed bool) {
108110// TODO: currently, the last filter to match wins always, but it shouldn't be that way.
109111// Instead, the highest-specific last filter should win; that way more specific filters
110112// override more general ones.
111- func (fs * Filters ) AddrBlocked (a Multiaddr ) (deny bool ) {
113+ func (fs * Filters ) AddrBlocked (a ma. Multiaddr ) (deny bool ) {
112114 var (
113115 netip net.IP
114116 found bool
115117 )
116118
117- ForEach (a , func (c Component ) bool {
119+ ma . ForEach (a , func (c ma. Component ) bool {
118120 switch c .Protocol ().Code {
119- case P_IP6ZONE :
121+ case ma . P_IP6ZONE :
120122 return true
121- case P_IP6 , P_IP4 :
123+ case ma . P_IP6 , ma . P_IP4 :
122124 found = true
123125 netip = net .IP (c .RawValue ())
124126 return false
Original file line number Diff line number Diff line change 1- package multiaddr
1+ package filter
22
33import (
44 "net"
@@ -66,7 +66,7 @@ func TestFilterBlocking(t *testing.T) {
6666 "/ip6/fd00::2/tcp/321" ,
6767 "/ip6/fc00::1/udp/321" ,
6868 } {
69- maddr , err := NewMultiaddr (blocked )
69+ maddr , err := ma . NewMultiaddr (blocked )
7070 if err != nil {
7171 t .Error (err )
7272 }
You can’t perform that action at this time.
0 commit comments