netfilter FAQ: correction to answer about UNREPLIED connections
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · Robert Bihlmeyer
Hi,
sorry for the late reply. I'm cc'ing netfilter-devel, since this might be of interest to other people.
Quoted 11 lines
the FAQ states
Quoted 4 lines
The answer is easy: UNREPLIED entries are temporary entries, i.e. as soon as we run out of connection tracking entries (we reach
/proc/sys/net/ipv4/ip_conntrack_max), we delete old UNREPLIED entries.As I read the source (linux 2.4.22), only entries without the ASSURED bit are dropped early. I have a number of connections in my table that are ESTABLISHED, UNREPLIED and ASSURED at the same time (I'm using the tcp-window-tracking patch, FWIW).
There is a bit of confusion what ESTABLISHED means. There are two ESTABLISHED.
a) TCP state (printed in /proc/net/ip_conntrack)
b) connection state (as used with the -m state --state match)
here it means that the state of the connection is ESTABLISHED. An ESTABLISHED connection must have had a NEW packet before - and it can never be ESTABLISHED without having seen at least one reply packet.
ASSURED is a bit set by the UDP and TCP helpers only. For TCP it means that we have seen a valid ACK in ESTABLISHED conntrack state, after SYN_RECV tcp state. For UDP it means that we've seen a matchin reply packet (inverted tuple). The general meaning is 'we are sure there is a connection from all we can tel'.
UNREPLIED means we have only seen packets in one direction. So the following combination in /proc/ip_conntrack is certainly invalid:
[UNREPLIED] [ASSURED]
How could we be sure about a connection, if we have not seen a reply packet before?
Quoted 3 lines
Either I'm experiencing a bug, and UNREPLIED connections should never get ASSURED, or the FAQ is wrong. Even in the former case ASSURED could get mentioned as the real criteria.
yes, indeed. Thanks for the correction.
Quoted 1 line
Robbe
Signature · 3 lines
- Harald Welte <[email protected]> http://www.gnumonks.org/ ============================================================================ Programming is like sex: One mistake and you have to support it your lifetime