@ -160,6 +160,11 @@ func Create(logf logger.Logf, tundev *tstun.Wrapper, e wgengine.Engine, mc *magi
NetworkProtocols : [ ] stack . NetworkProtocolFactory { ipv4 . NewProtocol , ipv6 . NewProtocol } ,
NetworkProtocols : [ ] stack . NetworkProtocolFactory { ipv4 . NewProtocol , ipv6 . NewProtocol } ,
TransportProtocols : [ ] stack . TransportProtocolFactory { tcp . NewProtocol , udp . NewProtocol , icmp . NewProtocol4 , icmp . NewProtocol6 } ,
TransportProtocols : [ ] stack . TransportProtocolFactory { tcp . NewProtocol , udp . NewProtocol , icmp . NewProtocol4 , icmp . NewProtocol6 } ,
} )
} )
sackEnabledOpt := tcpip . TCPSACKEnabled ( true ) // TCP SACK is disabled by default
tcpipErr := ipstack . SetTransportProtocolOption ( tcp . ProtocolNumber , & sackEnabledOpt )
if tcpipErr != nil {
return nil , fmt . Errorf ( "could not enable TCP SACK: %v" , tcpipErr )
}
linkEP := channel . New ( 512 , mtu , "" )
linkEP := channel . New ( 512 , mtu , "" )
if tcpipProblem := ipstack . CreateNIC ( nicID , linkEP ) ; tcpipProblem != nil {
if tcpipProblem := ipstack . CreateNIC ( nicID , linkEP ) ; tcpipProblem != nil {
return nil , fmt . Errorf ( "could not create netstack NIC: %v" , tcpipProblem )
return nil , fmt . Errorf ( "could not create netstack NIC: %v" , tcpipProblem )