summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/tcpip.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-08-16 23:07:42 +0000
committergVisor bot <gvisor-bot@google.com>2019-08-16 23:07:42 +0000
commit2c2fb24a621e341cfca57a8755561ebc705c92b1 (patch)
tree76de76d18e24d7821ec80c33c299813585908eab /pkg/tcpip/tcpip.go
parent45a9ddd9991852f4e5877414a82922e9797ce661 (diff)
parentf7114e0a27db788af512af8678595954996bcd7f (diff)
Merge f7114e0a (automated)
Diffstat (limited to 'pkg/tcpip/tcpip.go')
-rw-r--r--pkg/tcpip/tcpip.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go
index f664673b3..ba2dd85b8 100644
--- a/pkg/tcpip/tcpip.go
+++ b/pkg/tcpip/tcpip.go
@@ -168,6 +168,11 @@ func NewSubnet(a Address, m AddressMask) (Subnet, error) {
return Subnet{a, m}, nil
}
+// String implements Stringer.
+func (s Subnet) String() string {
+ return fmt.Sprintf("%s/%d", s.ID(), s.Prefix())
+}
+
// Contains returns true iff the address is of the same length and matches the
// subnet address and mask.
func (s *Subnet) Contains(a Address) bool {