diff options
author | Ghanan Gowripalan <ghanan@google.com> | 2020-11-24 11:48:09 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-24 11:50:00 -0800 |
commit | 732e98985546958fdab8ae3d49e36f17ae89f71c (patch) | |
tree | 16efeda1f25304990fad6676fa50a509d0b9f84a /pkg/tcpip/tcpip.go | |
parent | e5fd23c18d1fd602603babd8297dabf679c336aa (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.go | 10 |
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 |