Re: libnet_build_icmpv4_unreach is horribly broken
Frédéric Raynal <[email protected]>
| Newsgroups | gmane.comp.security.libnet |
|---|---|
| Message-ID | <20040302062235.A1462@batman> |
On Mon, Mar 01, 2004 at 05:55:24PM -0800, Mike Schiffman wrote:
>
> You can see that after the first packet is built and written correctly,
> the second packet has another IP header (with IP data pblock) tacked on
> at the end. I'm not sure how I'm going to solve this problem just yet
> -- probably get crafty with either saving these ptags internally or by
> using the payload interface (probably how it should be done in the
> first place). If anyone gets inspired and fixes this in the short term
> please let me know...
>
Sorry, it is 6 in the morning and I just wake up, so I may be thinking
about something even more broken than usually ;-/
Whe dont we replace the icmp_unreach-like builders (which have known
too many troubles) by something like the gre one ? The gre builder
also embed another IP header, but it is not provided as an argument of
the gre builder: the programmer must know what to do. And if he wants
to tunnel something else than IP, he can.
That is something like this (from samples/gre.c):
libnet_build_tcp()
libnet_build_ipv4()
libnet_build_gre()
libnet_build_ipv4()
We can do something similar with icmp_uncreach-like builders?
libnet_build_ipv4(payload)
libnet_build_icmpv4_unreach()
libnet_build_ipv4()
This have 2 drawbacks:
1. it breaks the current API
2. there is a bug during the checksum computation when several IP
packets are "tunneled" (see samples/gre.c)
Now, shower time to wake me up ... and maybe I'll see it was a
nightmare ;)
Fred Raynal