netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: Netfilter Development Mailinglist <netfilter-devel@vger.kernel.org>
Subject: Re: [PATCH 1/5] Add support for NAT sequence adjustments
Date: Tue, 11 Dec 2007 16:56:38 +0100	[thread overview]
Message-ID: <475EB336.2030503@netfilter.org> (raw)
In-Reply-To: <475C3D6E.9000800@trash.net>

Patrick McHardy wrote:
> Pablo Neira Ayuso wrote:
>> The combination of NAT and helpers may produce TCP sequence adjustments.
>> In failover setups, this information needs to be replicated in order to
>> achieve a successful recovery of mangled, related connections. This
>> patch is particularly useful for conntrackd, see:
>>
>>   
> +    /* NAT sequence adjustment */
> +    IPCT_NATSEQADJ_BIT = 13,
> +    IPCT_NATSEQADJ = (1 << IPCT_NATSEQADJ_BIT),
> 
> You don't seem to be using this bit for anything.

Hm, I think I did.

> @@ -191,6 +192,8 @@ nf_nat_mangle_tcp_packet(struct sk_buff 
>  		/* Tell TCP window tracking about seq change */
>  		nf_conntrack_tcp_update(skb, ip_hdrlen(skb),
>  					ct, CTINFO2DIR(ctinfo));
> +
> +		nf_conntrack_event_cache(IPCT_NATSEQADJ, skb);

Here we cache the NAT sequence adjustment event.

> ===================================================================
> --- net-2.6.git.orig/net/netfilter/nf_conntrack_netlink.c	2007-11-25 19:08:18.000000000 +0100
> +++ net-2.6.git/net/netfilter/nf_conntrack_netlink.c	2007-12-08 21:42:31.000000000 +0100
> @@ -424,6 +474,10 @@ static int ctnetlink_conntrack_event(str
>  		    (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
>  		     ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0))
>  			goto nla_put_failure;
> +
> +		if (events & IPCT_NATSEQADJ &&
> +		    ctnetlink_dump_nat_seq_adj(skb, ct) < 0)
> +			goto nla_put_failure;

And here we dump it.

  reply	other threads:[~2007-12-11 15:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-09 18:13 [PATCH 1/5] Add support for NAT sequence adjustments Pablo Neira Ayuso
2007-12-09 19:09 ` Patrick McHardy
2007-12-11 15:56   ` Pablo Neira Ayuso [this message]
2007-12-11 16:48     ` Patrick McHardy
2007-12-12  8:29 ` 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=475EB336.2030503@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).