[go-nuts] Setting the Don't Fragment (DF) bit on OSX

2021-04-22 Thread Marten Seemann
For my QUIC implementation , I'm trying to set the DF bit on outgoing packets. The following code works fine on Linux: addr, _ := net.ResolveUDPAddr("udp", ":0") conn, _ := net.ListenUDP("udp", addr) rawConn, _ := conn.SyscallConn() rawConn.Control(func

Re: [go-nuts] How to read (and write) the ECN bits?

2020-08-07 Thread Marten Seemann
Thank you guys, your tips were really helpful! Here's the solution I came up with for reading the ECN bits: After setting the IP_RECVTOS options syscall.SetsockoptInt(int(fd), syscall.IPPROTO_IP, syscall.IP_RECVTOS, 1) one can read packets from the socket using n, oobn, flags, addr, err := conn.Re