Sending a raw IP packet drops some fields from original IP header
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.
1 条评论