When sending an IP packet using a raw socket, the dispatch function in src/socket/raw.rs is called. This function parses the outgoing IP header into an Ipv4Repr to ensure its a valid packet, and then rebuilds that header using emit. Since Ipv4Repr is missing some fields (for example, ECN), any values that were set in the original header are dropped when the Ipv4Repr is rebuilt into the outgoing header. I imagine similar behavior exists for Ipv6Repr, but haven't investigated further.
When sending an IP packet using a raw socket, the
dispatchfunction insrc/socket/raw.rsis called. This function parses the outgoing IP header into anIpv4Reprto ensure its a valid packet, and then rebuilds that header usingemit. SinceIpv4Repris missing some fields (for example, ECN), any values that were set in the original header are dropped when theIpv4Repris rebuilt into the outgoing header. I imagine similar behavior exists forIpv6Repr, but haven't investigated further.