Commit Graph

8 Commits

Author SHA1 Message Date
Toby
ad1cb27c1b move set DF implementation to separate files & avoid the need for OOBCapablePacketConn (#3334)
* move set DF implementation to separate files & avoid the need for OOBCapablePacketConn

* merge err_size_* into conn_df_* & fix format
2022-03-07 15:21:23 +01:00
Rachel Chen
fd2c345152 sendQueue: ignore "datagram too large" error (#3328)
This commit introduces additional platform-dependent checking when the
kernel returns an error. Previously, the session is terminated when
PingFrame sends a discovery packet larger than the limit. With this
commit, the error is checked, and if it is "datagram too large", the
error is ignored.

Additionally,
1. This commit re-enables MTU discovery on Windows unless it
is disabled explicitly by user (Undo #3276),
2. Set IP_DONTFRAGMENT and IPV6_DONTFRAG with error checking on Windows,
   and
3. Set IP_MTU_DISCOVERY to PMTUDISC_DO for both IPv4 and IPv6 on Linux
   so that the kernel will return "message too long".

Fixes #3273 #3327
2022-02-20 00:21:32 -08:00
Sudarshan Reddy
c5aeee39ad use x/net/ipv{4,6} to construct oob info when writing packets (#3278) 2021-09-18 13:05:26 -07:00
Marten Seemann
59ea0daea1 run gofmt to add the new go:build tags 2021-09-14 18:37:41 +02:00
Audrius Butkevicius
3f3b8bda70 permit underlying conn to implement batch interface directly 2021-07-24 13:10:47 +02:00
Marten Seemann
870c759515 use batched reads 2021-06-27 15:45:10 -07:00
Marten Seemann
162cb16b31 cache the serialized OOB in the conn, not in the packet info
We're allocating a lot of packetInfo structs during the lifetime of a
connection. It's better to keep that struct as small as possible.
2021-03-16 14:04:15 +08:00
Olivier Poitrey
eb6bdfdfc1 Use the correct source IP when binding multiple IPs
When the server is listening on multiple interfaces or interfaces with
multiple IPs, the outgoing datagrams are sometime delivered with the
wrong source IP address.

In order to fix that, each quic connection needs to extract the
destination IP (and optionally interface id) of the received datagrams,
and set it as source IP (and interface) on the sent datagrams.

On most platforms, this can be done using ancillary data with recvmsg()
and sendmsg(). Some of the machinery for this is already there for ECN,
this change extends it to read the destination IP info and write it to
the outgoing packets.

Fix #1736
2021-03-16 00:50:05 +01:00