mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add support for IP_HDRINCL IP option for raw sockets.
Updates #2746 Fixes #3158 PiperOrigin-RevId: 320497190
This commit is contained in:
committed by
gVisor bot
parent
e506fcd931
commit
5946f11182
@@ -2112,13 +2112,22 @@ func setSockOptIP(t *kernel.Task, ep commonEndpoint, name int, optVal []byte) *s
|
||||
}
|
||||
return syserr.TranslateNetstackError(ep.SetSockOptBool(tcpip.ReceiveIPPacketInfoOption, v != 0))
|
||||
|
||||
case linux.IP_HDRINCL:
|
||||
if len(optVal) == 0 {
|
||||
return nil
|
||||
}
|
||||
v, err := parseIntOrChar(optVal)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return syserr.TranslateNetstackError(ep.SetSockOptBool(tcpip.IPHdrIncludedOption, v != 0))
|
||||
|
||||
case linux.IP_ADD_SOURCE_MEMBERSHIP,
|
||||
linux.IP_BIND_ADDRESS_NO_PORT,
|
||||
linux.IP_BLOCK_SOURCE,
|
||||
linux.IP_CHECKSUM,
|
||||
linux.IP_DROP_SOURCE_MEMBERSHIP,
|
||||
linux.IP_FREEBIND,
|
||||
linux.IP_HDRINCL,
|
||||
linux.IP_IPSEC_POLICY,
|
||||
linux.IP_MINTTL,
|
||||
linux.IP_MSFILTER,
|
||||
|
||||
Reference in New Issue
Block a user