Since ip_input() truncates the packet to ip->ip_len prior to entering the
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 28 Aug 2004 18:33:03 +0000 (18:33 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 28 Aug 2004 18:33:03 +0000 (18:33 +0000)
commitee7990a0cff3bca73ea287a5a41d65b68630f45d
tree07fe425bb5da17be125d2769e8a5c6150fed0db4
parent6b4cbefc6a3bfa05115059bca71e6aa46d78cadc
Since ip_input() truncates the packet to ip->ip_len prior to entering the
protocol stack, ip_demux must incorporate an ip_len check in its tcp/udp
prechecks to avoid an assertion in the tcp/udp stacks if the packet is
malformed.

This is a temporary hack until Jeff and I can come up with a better way
to do per-protocol mbuf checks.  Basically the issue involved is that we
want to pull up the entire tcp/udp/etc... header in order to be able to
trivially demux an IP packet (choose which protocol thread to route it to).
Since we have to m_pullup the packet in the demux we would rather do all
header length checks in the demux as well so as not have to repeat them in
the protocol code.

Reported-by: Sven Willenberger <sven@dmv.com>
In-discussion-with: Jeffrey Hsu
sys/netinet/ip_demux.c