All of lore.kernel.org
 help / color / mirror / Atom feed
* tcp match silently drops packets
@ 2005-10-10  3:01 Philip Craig
  2005-10-16  7:51 ` Yasuyuki KOZAKAI
  0 siblings, 1 reply; 19+ messages in thread
From: Philip Craig @ 2005-10-10  3:01 UTC (permalink / raw)
  To: netfilter-devel

If you send a 20 byte IP packet that has the protocol set to 6,
(ie TCP packet with no TCP header) then the following rule will match:

iptables -I FORWARD -p tcp

and the following rule will match and silently drop the packet:

iptables -I FORWARD -p tcp --syn

I think the behaviour of the first rule is fine, but the second one
should simply not match.  These packets probably should be dropped,
but this is a policy decision, and shouldn't be implemented in the
tcp match.  And if it must drop it, then a log message or counter
somewhere would be nice.

Conntracking marks the packet as INVALID, so you can use that to
drop it, and also log it if desired.

This isn't a big issue for me.  I had a TCPMSS rule before the INVALID
check, so I just need to reorder that.

There is a similar issue in TCPMSS itself: it has a few tests
that drop the packet.  In particular, it drops TCP SYN packets that
contain data.  Since TCPMSS isn't a firewall match (it is a hack to
try to avoid dropped packets), I don't think it makes sense for
it to drop packets that it can't handle.  I can submit a patch for
this if needed.

(Note: I tested this on 2.4.31.  There was some change to the tcp
hotdrop code as part of the skb linearization in 2.6, but from
reading the code, the behaviour looks the same.)

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2005-10-18  8:31 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-10  3:01 tcp match silently drops packets Philip Craig
2005-10-16  7:51 ` Yasuyuki KOZAKAI
2005-10-16 17:35   ` Henrik Nordstrom
2005-10-16 21:07     ` Henrik Nordstrom
2005-10-16 21:50       ` Herbert Xu
2005-10-17 19:30         ` Henrik Nordstrom
2005-10-17 21:27           ` Herbert Xu
2005-10-17 21:52             ` Henrik Nordstrom
2005-10-17  0:21       ` Philip Craig
2005-10-17 13:35         ` Henrik Nordstrom
2005-10-17 13:47       ` JC
2005-10-17 13:52         ` Henrik Nordstrom
2005-10-17 13:57           ` JC
2005-10-17 13:59             ` Henrik Nordstrom
2005-10-17 14:03               ` JC
2005-10-17 14:01           ` Cedric Blancher
2005-10-18  2:11           ` Herbert Xu
2005-10-18  8:31             ` Henrik Nordstrom
2005-10-17  0:18     ` Philip Craig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.