* [PATCH] netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch
@ 2017-04-19 18:39 Matthias Kaehlcke
2017-04-19 19:41 ` Joe Perches
2017-05-01 18:07 ` Matthias Kaehlcke
0 siblings, 2 replies; 5+ messages in thread
From: Matthias Kaehlcke @ 2017-04-19 18:39 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S . Miller
Cc: netfilter-devel, coreteam, netdev, linux-kernel, Grant Grundler,
Greg Hackmann, Michael Davidson, Matthias Kaehlcke
Not all parameters passed to ctnetlink_parse_tuple() and
ctnetlink_exp_dump_tuple() match the enum type in the signatures of these
functions. Since this is intended change the argument type of to be an int
value.
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
net/netfilter/nf_conntrack_netlink.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index dc7dfd68fafe..775eb5d9165b 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1006,9 +1006,8 @@ static const struct nla_policy tuple_nla_policy[CTA_TUPLE_MAX+1] = {
static int
ctnetlink_parse_tuple(const struct nlattr * const cda[],
- struct nf_conntrack_tuple *tuple,
- enum ctattr_type type, u_int8_t l3num,
- struct nf_conntrack_zone *zone)
+ struct nf_conntrack_tuple *tuple, u32 type,
+ u_int8_t l3num, struct nf_conntrack_zone *zone)
{
struct nlattr *tb[CTA_TUPLE_MAX+1];
int err;
@@ -2443,7 +2442,7 @@ static struct nfnl_ct_hook ctnetlink_glue_hook = {
static int ctnetlink_exp_dump_tuple(struct sk_buff *skb,
const struct nf_conntrack_tuple *tuple,
- enum ctattr_expect type)
+ u32 type)
{
struct nlattr *nest_parms;
--
2.12.2.816.g2cccc81164-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch
2017-04-19 18:39 [PATCH] netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch Matthias Kaehlcke
@ 2017-04-19 19:41 ` Joe Perches
2017-04-19 19:59 ` Matthias Kaehlcke
2017-05-01 18:07 ` Matthias Kaehlcke
1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2017-04-19 19:41 UTC (permalink / raw)
To: Matthias Kaehlcke, Pablo Neira Ayuso, Jozsef Kadlecsik, David S . Miller
Cc: netfilter-devel, coreteam, netdev, linux-kernel, Grant Grundler,
Greg Hackmann, Michael Davidson
On Wed, 2017-04-19 at 11:39 -0700, Matthias Kaehlcke wrote:
> Not all parameters passed to ctnetlink_parse_tuple() and
> ctnetlink_exp_dump_tuple() match the enum type in the signatures of these
> functions.
Maybe that should be changed/fixed.
> Since this is intended change the argument type of to be an int
> value.
u32 is not int, it's unsigned int
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
> net/netfilter/nf_conntrack_netlink.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
> index dc7dfd68fafe..775eb5d9165b 100644
> --- a/net/netfilter/nf_conntrack_netlink.c
> +++ b/net/netfilter/nf_conntrack_netlink.c
> @@ -1006,9 +1006,8 @@ static const struct nla_policy tuple_nla_policy[CTA_TUPLE_MAX+1] = {
>
> static int
> ctnetlink_parse_tuple(const struct nlattr * const cda[],
> - struct nf_conntrack_tuple *tuple,
> - enum ctattr_type type, u_int8_t l3num,
> - struct nf_conntrack_zone *zone)
> + struct nf_conntrack_tuple *tuple, u32 type,
> + u_int8_t l3num, struct nf_conntrack_zone *zone)
> {
> struct nlattr *tb[CTA_TUPLE_MAX+1];
> int err;
> @@ -2443,7 +2442,7 @@ static struct nfnl_ct_hook ctnetlink_glue_hook = {
>
> static int ctnetlink_exp_dump_tuple(struct sk_buff *skb,
> const struct nf_conntrack_tuple *tuple,
> - enum ctattr_expect type)
> + u32 type)
> {
> struct nlattr *nest_parms;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch
2017-04-19 19:41 ` Joe Perches
@ 2017-04-19 19:59 ` Matthias Kaehlcke
0 siblings, 0 replies; 5+ messages in thread
From: Matthias Kaehlcke @ 2017-04-19 19:59 UTC (permalink / raw)
To: Joe Perches
Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S . Miller,
netfilter-devel, coreteam, netdev, linux-kernel, Grant Grundler,
Greg Hackmann, Michael Davidson
El Wed, Apr 19, 2017 at 12:41:10PM -0700 Joe Perches ha dit:
> On Wed, 2017-04-19 at 11:39 -0700, Matthias Kaehlcke wrote:
> > Not all parameters passed to ctnetlink_parse_tuple() and
> > ctnetlink_exp_dump_tuple() match the enum type in the signatures of these
> > functions.
>
> Maybe that should be changed/fixed.
Please see the previous discussion at
http://www.spinics.net/lists/netfilter-devel/msg47540.html
> > Since this is intended change the argument type of to be an int
> > value.
>
> u32 is not int, it's unsigned int
I would argue that an unsigned int is an int(eger) and considered it
an unnecessary detail for the commit message to be explicit. I can
change it if others deem it incorrect.
Cheers
Matthias
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > ---
> > net/netfilter/nf_conntrack_netlink.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
> > index dc7dfd68fafe..775eb5d9165b 100644
> > --- a/net/netfilter/nf_conntrack_netlink.c
> > +++ b/net/netfilter/nf_conntrack_netlink.c
> > @@ -1006,9 +1006,8 @@ static const struct nla_policy tuple_nla_policy[CTA_TUPLE_MAX+1] = {
> >
> > static int
> > ctnetlink_parse_tuple(const struct nlattr * const cda[],
> > - struct nf_conntrack_tuple *tuple,
> > - enum ctattr_type type, u_int8_t l3num,
> > - struct nf_conntrack_zone *zone)
> > + struct nf_conntrack_tuple *tuple, u32 type,
> > + u_int8_t l3num, struct nf_conntrack_zone *zone)
> > {
> > struct nlattr *tb[CTA_TUPLE_MAX+1];
> > int err;
> > @@ -2443,7 +2442,7 @@ static struct nfnl_ct_hook ctnetlink_glue_hook = {
> >
> > static int ctnetlink_exp_dump_tuple(struct sk_buff *skb,
> > const struct nf_conntrack_tuple *tuple,
> > - enum ctattr_expect type)
> > + u32 type)
> > {
> > struct nlattr *nest_parms;
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch
2017-04-19 18:39 [PATCH] netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch Matthias Kaehlcke
2017-04-19 19:41 ` Joe Perches
@ 2017-05-01 18:07 ` Matthias Kaehlcke
2017-05-02 9:58 ` Pablo Neira Ayuso
1 sibling, 1 reply; 5+ messages in thread
From: Matthias Kaehlcke @ 2017-05-01 18:07 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S . Miller
Cc: netfilter-devel, coreteam, netdev, linux-kernel, Grant Grundler,
Greg Hackmann, Michael Davidson
El Wed, Apr 19, 2017 at 11:39:20AM -0700 Matthias Kaehlcke ha dit:
> Not all parameters passed to ctnetlink_parse_tuple() and
> ctnetlink_exp_dump_tuple() match the enum type in the signatures of these
> functions. Since this is intended change the argument type of to be an int
> value.
>
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---
Ping, any comments on this patch?
Thanks
Matthias
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch
2017-05-01 18:07 ` Matthias Kaehlcke
@ 2017-05-02 9:58 ` Pablo Neira Ayuso
0 siblings, 0 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2017-05-02 9:58 UTC (permalink / raw)
To: Matthias Kaehlcke
Cc: Jozsef Kadlecsik, David S . Miller, netfilter-devel, coreteam,
netdev, linux-kernel, Grant Grundler, Greg Hackmann,
Michael Davidson
On Mon, May 01, 2017 at 11:07:30AM -0700, Matthias Kaehlcke wrote:
> El Wed, Apr 19, 2017 at 11:39:20AM -0700 Matthias Kaehlcke ha dit:
>
> > Not all parameters passed to ctnetlink_parse_tuple() and
> > ctnetlink_exp_dump_tuple() match the enum type in the signatures of these
> > functions. Since this is intended change the argument type of to be an int
> > value.
> >
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > ---
>
> Ping, any comments on this patch?
I'll take this in the next batch.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-02 9:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 18:39 [PATCH] netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch Matthias Kaehlcke
2017-04-19 19:41 ` Joe Perches
2017-04-19 19:59 ` Matthias Kaehlcke
2017-05-01 18:07 ` Matthias Kaehlcke
2017-05-02 9:58 ` Pablo Neira Ayuso
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).