summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/tcpip.go
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2020-11-24 11:48:09 -0800
committergVisor bot <gvisor-bot@google.com>2020-11-24 11:50:00 -0800
commit732e98985546958fdab8ae3d49e36f17ae89f71c (patch)
tree16efeda1f25304990fad6676fa50a509d0b9f84a /pkg/tcpip/tcpip.go
parente5fd23c18d1fd602603babd8297dabf679c336aa (diff)
Extract IGMPv2 core state machine
The IGMPv2 core state machine can be shared with MLDv1 since they are almost identical, ignoring specific addresses, constants and packets. Bug #4682, #4861 PiperOrigin-RevId: 344102615
Diffstat (limited to 'pkg/tcpip/tcpip.go')
-rw-r--r--pkg/tcpip/tcpip.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go
index 3c7c5c0a8..40f6e8aa9 100644
--- a/pkg/tcpip/tcpip.go
+++ b/pkg/tcpip/tcpip.go
@@ -247,6 +247,16 @@ func (a Address) WithPrefix() AddressWithPrefix {
}
}
+// Unspecified returns true if the address is unspecified.
+func (a Address) Unspecified() bool {
+ for _, b := range a {
+ if b != 0 {
+ return false
+ }
+ }
+ return true
+}
+
// AddressMask is a bitmask for an address.
type AddressMask string