summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-08-17 19:48:58 +0000
committergVisor bot <gvisor-bot@google.com>2020-08-17 19:48:58 +0000
commitbc064d0878290cdab7b14d4d207d56c8902ae182 (patch)
tree9c4f9fefb6949af561b7829ecda460b817ca9a94 /pkg/tcpip
parent13546575552159b4bc62b8f7416a7b7173726c30 (diff)
parente3c4bbd10a93ac824af3204c520437f3d5ff470c (diff)
Merge release-20200810.0-40-ge3c4bbd10 (automated)
Diffstat (limited to 'pkg/tcpip')
-rw-r--r--pkg/tcpip/stack/nic.go18
-rw-r--r--pkg/tcpip/stack/stack.go13
2 files changed, 0 insertions, 31 deletions
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go
index 8a9a085f0..728292782 100644
--- a/pkg/tcpip/stack/nic.go
+++ b/pkg/tcpip/stack/nic.go
@@ -19,7 +19,6 @@ import (
"math/rand"
"reflect"
"sort"
- "strings"
"sync/atomic"
"gvisor.dev/gvisor/pkg/sync"
@@ -962,23 +961,6 @@ func (n *NIC) primaryAddress(proto tcpip.NetworkProtocolNumber) tcpip.AddressWit
return tcpip.AddressWithPrefix{}
}
-// AddressRanges returns the Subnets associated with this NIC.
-func (n *NIC) AddressRanges() []tcpip.Subnet {
- n.mu.RLock()
- defer n.mu.RUnlock()
- sns := make([]tcpip.Subnet, 0, len(n.mu.endpoints))
- for nid := range n.mu.endpoints {
- sn, err := tcpip.NewSubnet(nid.LocalAddress, tcpip.AddressMask(strings.Repeat("\xff", len(nid.LocalAddress))))
- if err != nil {
- // This should never happen as the mask has been carefully crafted to
- // match the address.
- panic("Invalid endpoint subnet: " + err.Error())
- }
- sns = append(sns, sn)
- }
- return sns
-}
-
// insertPrimaryEndpointLocked adds r to n's primary endpoint list as required
// by peb.
//
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go
index ae44cd5da..a3f87c8af 100644
--- a/pkg/tcpip/stack/stack.go
+++ b/pkg/tcpip/stack/stack.go
@@ -1102,19 +1102,6 @@ func (s *Stack) removeNICLocked(id tcpip.NICID) *tcpip.Error {
return nic.remove()
}
-// NICAddressRanges returns a map of NICIDs to their associated subnets.
-func (s *Stack) NICAddressRanges() map[tcpip.NICID][]tcpip.Subnet {
- s.mu.RLock()
- defer s.mu.RUnlock()
-
- nics := map[tcpip.NICID][]tcpip.Subnet{}
-
- for id, nic := range s.nics {
- nics[id] = append(nics[id], nic.AddressRanges()...)
- }
- return nics
-}
-
// NICInfo captures the name and addresses assigned to a NIC.
type NICInfo struct {
Name string