All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: xtables: add cluster match
Date: Fri, 20 Feb 2009 14:48:56 +0100	[thread overview]
Message-ID: <499EB4C8.5090103@trash.net> (raw)
In-Reply-To: <499EACEC.60702@netfilter.org>

Pablo Neira Ayuso wrote:
> Patrick McHardy wrote:
>> Pablo Neira Ayuso wrote:
>>> +    if (ct->master)
>>> +        hash = xt_cluster_hash(ct->master, info);
>>> +    else
>>> +        hash = xt_cluster_hash(ct, info);
>>
>> This makes a lot of sense for helpers like SIP, where the expectation
>> can arrive from a different source address. I'm just wondering how
>> this works when not using reliable synchronization - in that case, other
>> nodes might not be aware of the expectation and also accept the packet.
>> I don't have a suggestion besides making sure expectations are
>> synchronized, just thought I'd point it out.
> 
> Indeed.
> 
> This sort of problem is interesting, just in case that you have some 
> spare time to think about other synchronization-related problems 
> (otherwise you can skip the following below :)). Conntrackd does not 
> synchronize expectations (at least, it's not in my plans yet), it 
> synchronizes conntrack entries, and that includes the relationship 
> between master and related conntracks. Thus, after the failover, the new 
> primary node knows that the master connection has a helper (so it can 
> create new expectations) and already existing established-related 
> connections are linked to the master conntracks.
> 
> Still I see two possible problematic situations with these approach:
> 
>  * If expectations are not propagated, this means than a FTP-data 
> connections that is about to start would not success if that connection 
> happens during a failover as the expectation information is lost.
> 
>  * If the state information is lost for whatever reason (like not using 
> conntrackd at all or losing the state information due to netlink 
> unreliability), then the former expected connection would be handled 
> like a normal connection by one cluster node. For example, this would 
> break if destination nat is used in the case of FTP (and similarly for 
> other helpers I think).
> 
> For the first problem, I can say that conntrackd can be tuned to reduce 
> the chances of this to happen (at the cost of investing more resources 
> in the synchronization). Moreover, connections that are about to start 
> may retry in short and no data was exchanged indeed.

Good point.

> For the second problem, this is actually the sort of problems that I 
> want to avoid making netlink reliable by dropping packets. By reducing 
> the chances to lose state information for whatever reason.

Yes, although the netlink delivery only covers part of it. It might
be the path where most events are lost though.

>>> +static bool xt_cluster_mt_checkentry(const struct xt_mtchk_param *par)
>>> +{
>>> +    struct xt_cluster_match_info *info = par->matchinfo;
>>> +
>>> +    if (info->node_mask > (1 << info->total_nodes)) {
>>> +        printk(KERN_ERR "xt_cluster: the id of this node cannot be "
>>> +                "higher than the total number of nodes\n");
>>
>> This looks like an off-by-one (warning: still at first coffee :)).
>> It may also not be equal to the mask I'd expect. I can change it
>> to >= when applying if you agree.
> 
> You're right! Please change it.

I noticed another problem during compilation:

net/netfilter/xt_cluster.c: In function 'xt_cluster_mt':
net/netfilter/xt_cluster.c:124: warning: passing argument 2 of 
'constant_test_bit' from incompatible pointer type
net/netfilter/xt_cluster.c:124: warning: passing argument 2 of 
'variable_test_bit' from incompatible pointer type

The problem is that is uses a u32 for the mask, but the bitops are
only defined for unsigned longs. Which is a bit unfortunate since
they're not well suited for ABI structures. I'd suggest to simply
open-code the bit tests.


  reply	other threads:[~2009-02-20 13:48 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19 23:14 [PATCH] netfilter: xtables: add cluster match Pablo Neira Ayuso
2009-02-20  9:24 ` Patrick McHardy
2009-02-20 13:15   ` Pablo Neira Ayuso
2009-02-20 13:48     ` Patrick McHardy [this message]
2009-02-20 16:52       ` Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2009-02-23 10:13 Pablo Neira Ayuso
2009-02-24 13:46 ` Patrick McHardy
2009-02-24 14:05   ` Pablo Neira Ayuso
2009-02-24 14:06     ` Patrick McHardy
2009-02-24 23:13       ` Pablo Neira Ayuso
2009-02-25  5:52         ` Patrick McHardy
2009-02-25  9:42           ` Pablo Neira Ayuso
2009-02-25 10:20             ` Patrick McHardy
2009-03-16 16:11 ` Patrick McHardy
2009-02-20 20:50 Pablo Neira Ayuso
2009-02-20 20:56 ` Pablo Neira Ayuso
2009-02-16  9:32 Pablo Neira Ayuso
2009-02-16  9:23 Pablo Neira Ayuso
2009-02-16  9:31 ` Pablo Neira Ayuso
2009-02-16 12:13   ` Jan Engelhardt
2009-02-16 12:17     ` Patrick McHardy
2009-02-14 19:29 Pablo Neira Ayuso
2009-02-14 20:28 ` Jan Engelhardt
2009-02-14 20:42   ` Pablo Neira Ayuso
2009-02-14 22:31     ` Jan Engelhardt
2009-02-14 22:32       ` Jan Engelhardt
2009-02-16 10:56 ` Patrick McHardy
2009-02-16 14:01   ` Pablo Neira Ayuso
2009-02-16 14:03     ` Patrick McHardy
2009-02-16 14:30       ` Pablo Neira Ayuso
2009-02-16 15:01         ` Patrick McHardy
2009-02-16 15:14         ` Pablo Neira Ayuso
2009-02-16 15:10           ` Patrick McHardy
2009-02-16 15:27             ` Pablo Neira Ayuso
2009-02-17 10:46             ` Pablo Neira Ayuso
2009-02-17 10:50               ` Patrick McHardy
2009-02-17 13:50                 ` Pablo Neira Ayuso
2009-02-17 19:45                   ` Vincent Bernat
2009-02-18 10:14                     ` Patrick McHardy
2009-02-18 10:13                   ` Patrick McHardy
2009-02-18 11:06                     ` Pablo Neira Ayuso
2009-02-18 11:14                       ` Patrick McHardy
2009-02-18 17:20                       ` Vincent Bernat
2009-02-18 17:25                         ` Patrick McHardy
2009-02-18 18:38                           ` Pablo Neira Ayuso
2009-02-16 17:17         ` Jan Engelhardt
2009-02-16 17:13     ` Jan Engelhardt
2009-02-16 17:16       ` Patrick McHardy
2009-02-16 17:22         ` Jan Engelhardt

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=499EB4C8.5090103@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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.