mirror of
https://github.com/miekg/dns.git
synced 2025-08-11 20:16:58 +02:00
20 lines
270 B
Go
20 lines
270 B
Go
// +build linux
|
|
|
|
package dns
|
|
|
|
import (
|
|
"net"
|
|
"syscall"
|
|
)
|
|
|
|
func udpSocketOobData(conn *net.UDPConn) (err error) {
|
|
file, err := conn.File()
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
err = syscall.SetsockoptInt(int(file.Fd()), syscall.IPPROTO_IP, syscall.IP_PKTINFO, 1)
|
|
|
|
return
|
|
}
|