From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: Eric Paris <eparis@redhat.com>,
netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org,
coreteam@netfilter.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfilter: NF_HOOK_COND has wrong conditional
Date: Fri, 12 Nov 2010 08:32:10 +0100 [thread overview]
Message-ID: <4CDCED7A.9040202@trash.net> (raw)
In-Reply-To: <alpine.LNX.2.01.1011112148100.30863@obet.zrqbmnf.qr>
On 11.11.2010 21:49, Jan Engelhardt wrote:
> On Thursday 2010-11-11 20:09, Eric Paris wrote:
>
>> The NF_HOOK_COND returns 0 when it shouldn't due to what I believe to be an
>> error in the code as the order of operations is not what was intended. C will
>> evalutate == before =. Which means ret is getting set to the bool result,
>> rather than the return value of the function call. The code says
>>
>> if (ret = function() == 1)
>> when it meant to say:
>> if ((ret = function()) == 1)
>
> Thanks for catching. Indeed (ret = f) == 1 is desired, as can be seen in
> patch 2249065f4b22b493bae2caf549b86f175f33188e.
Applied, thanks Eric.
prev parent reply other threads:[~2010-11-12 7:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 19:09 [PATCH] netfilter: NF_HOOK_COND has wrong conditional Eric Paris
2010-11-11 20:49 ` Jan Engelhardt
2010-11-12 7:32 ` Patrick McHardy [this message]
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=4CDCED7A.9040202@trash.net \
--to=kaber@trash.net \
--cc=coreteam@netfilter.org \
--cc=eparis@redhat.com \
--cc=jengelh@medozas.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=netfilter@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).