From: Patrick McHardy <kaber@trash.net>
To: dccp@vger.kernel.org
Subject: Re: DCCP conntrack/NAT
Date: Sun, 06 Apr 2008 00:28:35 +0000 [thread overview]
Message-ID: <47F81933.4050102@trash.net> (raw)
In-Reply-To: <47F64C0D.5080700@trash.net>
Pablo Neira Ayuso wrote:
> Jan Engelhardt wrote:
>
>>> +static int dccp_pkt_to_tuple(const struct sk_buff *skb, unsigned int
>>> dataoff,
>>> + struct nf_conntrack_tuple *tuple)
>>> +{
>>> + struct dccp_hdr _hdr, *dh;
>>> +
>>> + dh = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr);
>>> + if (dh = NULL)
>>> + return 0;
>>> +
>> skb_header_pointer() is used for the case of a non-linear skb (has to
>> do with IP fragments?).
>>
>
> Indeed.
>
>
>> In ipv4_pkt_to_tuple in nf_conntrack_l3proto_ipv4.c,
>> skb_header_pointer() is used to get the [source address of the] IP
>> header. Since I figured the layer-3 header must always be
>> unfragmented, would not it be simpler to use ip_hdr(), or is there
>> something that mandates use of skb_header_pointer?
>>
>
> Right. I think that we can assume that the IP header is always linear (I
> remember this from a conversation with Davem or Rusty), Patrick?
>
Right, the IP header is linearized by ip_rcv() (or bridge netfilter).
The pkt_to_tuple functions may be called for the inner packet of an
ICMP message however, which might be in the non-linear area.
WARNING: multiple messages have this Message-ID (diff)
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jan Engelhardt <jengelh@computergmbh.de>,
Gerrit Renker <gerrit@erg.abdn.ac.uk>,
dccp@vger.kernel.org,
Netfilter Development Mailinglist
<netfilter-devel@vger.kernel.org>
Subject: Re: DCCP conntrack/NAT
Date: Sun, 06 Apr 2008 02:28:35 +0200 [thread overview]
Message-ID: <47F81933.4050102@trash.net> (raw)
In-Reply-To: <47F74FE7.2040809@netfilter.org>
Pablo Neira Ayuso wrote:
> Jan Engelhardt wrote:
>
>>> +static int dccp_pkt_to_tuple(const struct sk_buff *skb, unsigned int
>>> dataoff,
>>> + struct nf_conntrack_tuple *tuple)
>>> +{
>>> + struct dccp_hdr _hdr, *dh;
>>> +
>>> + dh = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr);
>>> + if (dh == NULL)
>>> + return 0;
>>> +
>> skb_header_pointer() is used for the case of a non-linear skb (has to
>> do with IP fragments?).
>>
>
> Indeed.
>
>
>> In ipv4_pkt_to_tuple in nf_conntrack_l3proto_ipv4.c,
>> skb_header_pointer() is used to get the [source address of the] IP
>> header. Since I figured the layer-3 header must always be
>> unfragmented, would not it be simpler to use ip_hdr(), or is there
>> something that mandates use of skb_header_pointer?
>>
>
> Right. I think that we can assume that the IP header is always linear (I
> remember this from a conversation with Davem or Rusty), Patrick?
>
Right, the IP header is linearized by ip_rcv() (or bridge netfilter).
The pkt_to_tuple functions may be called for the inner packet of an
ICMP message however, which might be in the non-linear area.
next prev parent reply other threads:[~2008-04-06 0:28 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-04 15:41 DCCP conntrack/NAT Patrick McHardy
2008-04-04 15:41 ` Patrick McHardy
2008-04-04 19:59 ` Jan Engelhardt
2008-04-04 19:59 ` Jan Engelhardt
2008-04-05 10:09 ` Pablo Neira Ayuso
2008-04-05 10:09 ` Pablo Neira Ayuso
2008-04-05 10:12 ` Pablo Neira Ayuso
2008-04-05 10:12 ` Pablo Neira Ayuso
2008-04-06 0:28 ` Patrick McHardy [this message]
2008-04-06 0:28 ` Patrick McHardy
2008-04-07 21:50 ` Gerrit Renker
2008-04-07 21:50 ` Gerrit Renker
2008-04-07 22:45 ` Patrick McHardy
2008-04-07 22:45 ` Patrick McHardy
2008-04-08 9:27 ` Gerrit Renker
2008-04-08 9:27 ` Gerrit Renker
2008-04-08 10:30 ` Patrick McHardy
2008-04-08 10:30 ` Patrick McHardy
2008-04-08 10:33 ` Patrick McHardy
2008-04-08 10:33 ` Patrick McHardy
2008-04-08 11:18 ` Patrick McHardy
2008-04-08 11:18 ` Patrick McHardy
2008-04-08 13:38 ` Gerrit Renker
2008-04-08 13:38 ` Gerrit Renker
2008-04-08 14:12 ` Patrick McHardy
2008-04-08 14:12 ` Patrick McHardy
2008-04-08 14:26 ` Patrick McHardy
2008-04-08 14:26 ` Patrick McHardy
2008-04-08 16:21 ` Patrick McHardy
2008-04-08 16:21 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47F81933.4050102@trash.net \
--to=kaber@trash.net \
--cc=dccp@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.