This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

set a custom ip length in an ip packet

0

hi, i have a custom dissector, after dissect this custom protocol, the remaining of the packet should be dissect as an ip packet. but the length of ip packet report in my custom dissector and ip length field set to zero in data.

ip packets are like this : 0x45000000....

0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
Total Length:0

i want to read Total Length from my custom protocol not the 2-3th bytes of data.can any one help me?thanks

asked 31 Aug '17, 12:31

ghader's gravatar image

ghader
61141620
accept rate: 0%

edited 31 Aug '17, 12:32


One Answer:

0

but the length of ip packet report in my custom dissector and ip length field set to zero in data.

Then it's not a valid IP packet. Fix your custom protocol, or its implementation, to provide a valid length field in the IP header.

answered 31 Aug '17, 14:35

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%