Skip to main content

dgram_header

Function dgram_header 

Source
pub fn dgram_header(client: SocketAddr, backend: SocketAddr) -> Vec<u8> 
Expand description

Build the PPv2 DGRAM header bytes for a datagram whose real client source is client and whose backend destination is backend.

When the two addresses are mixed-family (one v4, one v6 — which the UDP datapath never produces, since the connected upstream socket matches the backend family) this falls back to an AF_UNSPEC / UNSPEC header with a zero-length address block, exactly as the TCP serializer does. The backend must then treat the connection as un-proxied, per the spec’s UNSPEC rule.