mirror of
https://github.com/golang/sys.git
synced 2026-02-09 04:06:04 +03:00
unix: add SetsockoptPacketMreq on Linux
Add SetsockoptPacketMreq to set packet socket options used to configure physical-layer multi‐casting and promiscuous mode (PACKET_ADD_MEMBERSHIP, PACKET_DROP_MEMBERSHIP). Change-Id: I0f292315ad1c57e6a3d1dd12f5f29be70d8bfd54 Reviewed-on: https://go-review.googlesource.com/c/sys/+/165977 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
b294cbcfc5
commit
572b51eaf7
@@ -1022,6 +1022,10 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
|
||||
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
|
||||
}
|
||||
|
||||
func SetsockoptPacketMreq(fd, level, opt int, mreq *PacketMreq) error {
|
||||
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
|
||||
}
|
||||
|
||||
// SetsockoptSockFprog attaches a classic BPF or an extended BPF program to a
|
||||
// socket to filter incoming packets. See 'man 7 socket' for usage information.
|
||||
func SetsockoptSockFprog(fd, level, opt int, fprog *SockFprog) error {
|
||||
|
||||
Reference in New Issue
Block a user