All of lore.kernel.org
 help / color / mirror / Atom feed
* bug in icmp tracking?
@ 2004-03-09 19:44 Pablo Neira
  2004-03-09 20:35 ` Patrick McHardy
  2004-03-09 20:47 ` Martin Josefsson
  0 siblings, 2 replies; 4+ messages in thread
From: Pablo Neira @ 2004-03-09 19:44 UTC (permalink / raw)
  To: netfilter-devel

Hi list,

I sent some ICMP echo's request and I received the echo's reply with no 
problems but the conntrack doesn't track them.

This is because the value returned by icmp_error_track called from 
ip_conntrack_in.

snipped from icmp_error_track(...):

514         if (inside.icmp.type != ICMP_DEST_UNREACH
515             && inside.icmp.type != ICMP_SOURCE_QUENCH
516             && inside.icmp.type != ICMP_TIME_EXCEEDED
517             && inside.icmp.type != ICMP_PARAMETERPROB
518             && inside.icmp.type != ICMP_REDIRECT)
519                 return NULL;

I also had a look at the docs and I didn't find anything like "icmp are 
not tracked because of something...".

So, is this a bug or a feature?

regards,
Pablo

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

* Re: bug in icmp tracking?
  2004-03-09 19:44 bug in icmp tracking? Pablo Neira
@ 2004-03-09 20:35 ` Patrick McHardy
  2004-03-09 20:47 ` Martin Josefsson
  1 sibling, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2004-03-09 20:35 UTC (permalink / raw)
  To: Pablo Neira; +Cc: netfilter-devel

Pablo Neira wrote:
> Hi list,
> 
> I sent some ICMP echo's request and I received the echo's reply with no 
> problems but the conntrack doesn't track them.
> 
> This is because the value returned by icmp_error_track called from 
> ip_conntrack_in.
> 
> snipped from icmp_error_track(...):
> 
> 514         if (inside.icmp.type != ICMP_DEST_UNREACH
> 515             && inside.icmp.type != ICMP_SOURCE_QUENCH
> 516             && inside.icmp.type != ICMP_TIME_EXCEEDED
> 517             && inside.icmp.type != ICMP_PARAMETERPROB
> 518             && inside.icmp.type != ICMP_REDIRECT)
> 519                 return NULL;
> 
> I also had a look at the docs and I didn't find anything like "icmp are 
> not tracked because of something...".
> 
> So, is this a bug or a feature?

Neither of both, you looked in the wrong place ;)
This function only tracks ICMP errors, ICMP echo-request messages
are handled by ip_conntrack_proto_icmp .. the conntrack entry
itself is removed immediately when there are no more outstanding
replies.

Regards
Patrick

> 
> regards,
> Pablo
> 

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

* Re: bug in icmp tracking?
  2004-03-09 19:44 bug in icmp tracking? Pablo Neira
  2004-03-09 20:35 ` Patrick McHardy
@ 2004-03-09 20:47 ` Martin Josefsson
  2004-03-09 21:02   ` Pablo Neira
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Josefsson @ 2004-03-09 20:47 UTC (permalink / raw)
  To: Pablo Neira; +Cc: Netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]

On Tue, 2004-03-09 at 20:44, Pablo Neira wrote:
> Hi list,
> 
> I sent some ICMP echo's request and I received the echo's reply with no 
> problems but the conntrack doesn't track them.

Conntrack tracks icmp-echo-requests and icmp-echo-replies just fine.

> This is because the value returned by icmp_error_track called from 
> ip_conntrack_in.
> 
> snipped from icmp_error_track(...):
> 
> 514         if (inside.icmp.type != ICMP_DEST_UNREACH
> 515             && inside.icmp.type != ICMP_SOURCE_QUENCH
> 516             && inside.icmp.type != ICMP_TIME_EXCEEDED
> 517             && inside.icmp.type != ICMP_PARAMETERPROB
> 518             && inside.icmp.type != ICMP_REDIRECT)
> 519                 return NULL;
> 
> I also had a look at the docs and I didn't find anything like "icmp are 
> not tracked because of something...".
> 
> So, is this a bug or a feature?

from ip_conntrack_in()

        /* It may be an icmp error... */
        if ((*pskb)->nh.iph->protocol == IPPROTO_ICMP
            && icmp_error_track(*pskb, &ctinfo, hooknum))
                return NF_ACCEPT;

An icmp-echo-request/reply causes icmp_error_track() to return NULL and
thus the above if-statement won't match... = the packets are tracked.
You probably won't see them in /proc/net/ip_conntrack since they are
removed as soon as the reply has been seen, which probably is around 1ms
after you were added, you have to be quite lucky in order to see them in
that file.

Apply the ctstat patch and see for yourself when you ping.

-- 
/Martin

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: bug in icmp tracking?
  2004-03-09 20:47 ` Martin Josefsson
@ 2004-03-09 21:02   ` Pablo Neira
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira @ 2004-03-09 21:02 UTC (permalink / raw)
  To: Martin Josefsson, netfilter-devel

Hi Martin,

Martin Josefsson wrote:

>You probably won't see them in /proc/net/ip_conntrack since they are
>removed as soon as the reply has been seen, which probably is around 1ms
>after you were added, you have to be quite lucky in order to see them in
>that file.
>  
>
Actually, this was my error, looking at /proc/net/ip_conntrack, this got 
me confused.

thanks,
Pablo

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

end of thread, other threads:[~2004-03-09 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-09 19:44 bug in icmp tracking? Pablo Neira
2004-03-09 20:35 ` Patrick McHardy
2004-03-09 20:47 ` Martin Josefsson
2004-03-09 21:02   ` Pablo Neira

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.