quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.85k stars 394 forks source link

Add support for IP_RECVORIGDSTADDR socket option. #1462

Closed PiotrSikora closed 1 year ago

PiotrSikora commented 1 year ago

When enabled on a socket with IP_TRANSPARENT, it populates metadata with the original destination (IP:port) for traffic redirected with TPROXY.

Signed-off-by: Piotr Sikora piotr@aviatrix.com

Ralith commented 1 year ago

What's the use case for this?

PiotrSikora commented 1 year ago

What's the use case for this?

This allows a QUIC/UDP proxy that intercepted traffic using TPROXY to forward traffic towards the original destination.

Note that if the original socket doesn't have IP_TRANSPARENT socket option enabled, then this won't receive any new CMSGs, so the overhead of having this enabled if pretty small.

Ralith commented 1 year ago

quinn-udp is primarily intended to support the requirements of Quinn. Is there a way you imagine Quinn using this functionality? If not, forking/vendoring the logic your application needs might make more sense.