public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp•com.au>
To: Dan Carpenter <dan.carpenter@oracle•com>
Cc: netdev@vger•kernel.org, netfilter-devel@vger•kernel.org
Subject: re: module_param: make bool parameters really bool (net & drivers/net)
Date: Fri, 23 Mar 2012 08:37:09 +1030	[thread overview]
Message-ID: <8762dw9to2.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20120322182623.GA29859@elgon.mountain>

On Thu, 22 Mar 2012 21:26:23 +0300, Dan Carpenter <dan.carpenter@oracle•com> wrote:
> Hi Rusty,
> 
> The patch eb93992207da: "module_param: make bool parameters really
> bool (net & drivers/net)" from Dec 19, 2011, leads to the following
> warning:
> net/ipv4/netfilter/iptable_filter.c:90 iptable_filter_init()
> 	warn: 5 is more than 1 (max 'forward' can be) so this is
> 	always the same.
> 
> It's declared like this:
> 
>     54  /* Default to forward because I got too much mail already. */
>     55  static bool forward = NF_ACCEPT;
>     56  module_param(forward, bool, 0000);
> 
> 
> It's used like this:
>     66          ((struct ipt_standard *)repl->entries)[1].target.verdict = -forward - 1;
> 
> Smatch complains when check that it's larger than 5.
> 
>     90          if (forward < 0 || forward > NF_MAX_VERDICT) {
>     91                  pr_err("iptables forward must be 0 or 1\n");
>     92                  return -EINVAL;
>     93          }

Thanks Dan!

        This was obviously initially an arbitrary value, but someone
made it a bool module parameter (me?).  It works for accept and drop, so
let's make it official.  Patch coming.

Thanks,
Rusty.
-- 
  How could I marry someone with more hair than me?  http://baldalex.org

  parent reply	other threads:[~2012-03-22 22:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 18:26 module_param: make bool parameters really bool (net & drivers/net) Dan Carpenter
2012-03-22 18:30 ` Dan Carpenter
2012-03-22 22:07 ` Rusty Russell [this message]
2012-03-22 22:27   ` [PATCH] netfilter: remove forward module param confusion Rusty Russell
2012-03-23  2:36     ` David Miller

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=8762dw9to2.fsf@rustcorp.com.au \
    --to=rusty@rustcorp$(echo .)com.au \
    --cc=dan.carpenter@oracle$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=netfilter-devel@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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