Closed StackOverflowExcept1on closed 1 year ago
I'm trying to use custom udp packet builder with almost same code: https://github.com/JulianSchmid/etherparse/blob/master/examples/write_ipv4_udp.rs
some context to show the error later
//setup the actual payload of the udp packet let udp_payload = [1,2,3,4,5,6,7,8]; //source ip address [192,168,1,42], //destination ip address [192,168,1,1]
$ cargo run --example=write_ipv4_udp [1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 15, 16, 8, 0, 69, 0, 0, 36, 0, 0, 64, 0, 20, 17, 227, 77, 192, 168, 1, 42, 192, 168, 1, 1, 0, 0, 0, 42, 0, 16, 108, 20]
IPv4: (start from 0x45/69)
[69, 0, 0, 36, 0, 0, 64, 0, 20, 17, 227, 77, 192, 168, 1, 42, 192, 168, 1, 1, 0, 0, 0, 42, 0, 16, 108, 20]
I'm using raw sockets to send it and Wireshark to view packets software shows that UDP packet is invalid
payload length is calculated as udp_header_len + payload.len() = 8 + 8 = 16 but as we see there is no payload at the generated packet
udp_header_len + payload.len() = 8 + 8 = 16
payload
Good catch & thanks for the fix.
I'm trying to use custom udp packet builder with almost same code: https://github.com/JulianSchmid/etherparse/blob/master/examples/write_ipv4_udp.rs
some context to show the error later
IPv4: (start from 0x45/69)
I'm using raw sockets to send it and Wireshark to view packets software shows that UDP packet is invalid
payload length is calculated as
udp_header_len + payload.len() = 8 + 8 = 16
but as we see there is nopayload
at the generated packet