Support add/remove IPv6 multicast group sock opt

IPv4 was always supported but UDP never supported joining/leaving IPv6
multicast groups via socket options.

Add: IPPROTO_IPV6, IPV6_JOIN_GROUP/IPV6_ADD_MEMBERSHIP
Remove: IPPROTO_IPV6, IPV6_LEAVE_GROUP/IPV6_DROP_MEMBERSHIP

Test: integration_test.TestUDPAddRemoveMembershipSocketOption
PiperOrigin-RevId: 350396072
This commit is contained in:
Ghanan Gowripalan
2021-01-06 11:41:42 -08:00
committed by gVisor bot
parent 0c4118d5b8
commit abe9d9f67f
15 changed files with 708 additions and 232 deletions
+6
View File
@@ -250,6 +250,12 @@ type SockAddrInet struct {
_ [8]uint8 // pad to sizeof(struct sockaddr).
}
// Inet6MulticastRequest is struct ipv6_mreq, from uapi/linux/in6.h.
type Inet6MulticastRequest struct {
MulticastAddr Inet6Addr
InterfaceIndex int32
}
// InetMulticastRequest is struct ip_mreq, from uapi/linux/in.h.
type InetMulticastRequest struct {
MulticastAddr InetAddr