Re: [PATCH]: Check for duplicated conflicting proxies

From: Krzysztof Oledzki <ole#ans.pl>
Date: Sun, 21 Oct 2007 02:55:17 +0200 (CEST)

On Sat, 20 Oct 2007, Krzysztof Oledzki wrote:

>
>
> On Sat, 20 Oct 2007, Willy Tarreau wrote:
> <CUT>
>> I agree with your table, but the "if" becomes hard to understand IMHO.
>> I wouldn't like to read it at 3am. I'd rather use something like this :
>>
>> if (!((x == PR_CAP_FE && y == PR_CAP_BE) ||
>> (x == PR_CAP_BE && y == PR_CAP_FE)))
>>
>> Basically, it explicitly catches all cases where the two entries are
>> not exactly one FE and one BE, with both being different. Also, since
>> we've been discussing it, it would be good to add a good comment around
>> the test.
>
> Right, I will cook a patch that explicitly matches FE and BE. Anyway,
> comparing "x == PR_CAP_FE" is still not enough as frontend is defined as
> "PR_CAP_FE | PR_CAP_RS", similar for backend.

Currently haproxy accepts a config with duplicated proxies (listen/fronted/backed/ruleset). This patch fix this, so the application will complain when there is an error.

With this modification it is still possible to use the same name for two proxies (for example frontend&backend) as long there is no conflict:

                 listen backend frontend ruleset
listen             -      -       -        -
backend            -      -       OK       -
frontend           -      OK      -        -
ruleset            -      -       -        -

Best regards,

                                 Krzysztof Olędzki

Received on 2007/10/21 02:55

This archive was generated by hypermail 2.2.0 : 2007/11/04 19:21 CET