diff mbox

Doubt about CTA_EXPECT_* values passed to ctnetlink_parse_tuple()

Message ID 20170418083947.GA1720@salvia
State RFC
Delegated to: Pablo Neira
Headers show

Commit Message

Pablo Neira Ayuso April 18, 2017, 8:39 a.m. UTC
Hi Mattias,

On Mon, Apr 17, 2017 at 03:37:30PM -0700, Matthias Kaehlcke wrote:
> Hi,
> 
> While working on clang support for kernel builds I came across at what
> at first sight looks like an enum mismatch in the netfilter conntrack
> code:
> 
> In multiple occasions CTA_EXPECT_* values (of type enum ctattr_expect)
> are passed to ctnetlink_parse_tuple(), which expects an 'enum
> ctattr_type' as type argument.

Are you refering to this? See patch.

Comments

Matthias Kaehlcke April 18, 2017, 7:41 p.m. UTC | #1
Hi Pablo,

Thanks for your reply!

El Tue, Apr 18, 2017 at 10:39:47AM +0200 Pablo Neira Ayuso ha dit:

> On Mon, Apr 17, 2017 at 03:37:30PM -0700, Matthias Kaehlcke wrote:
> > Hi,
> > 
> > While working on clang support for kernel builds I came across at what
> > at first sight looks like an enum mismatch in the netfilter conntrack
> > code:
> > 
> > In multiple occasions CTA_EXPECT_* values (of type enum ctattr_expect)
> > are passed to ctnetlink_parse_tuple(), which expects an 'enum
> > ctattr_type' as type argument.
> 
> Are you refering to this? See patch.

Almost, see patch :)

I interpret that passing the different enum types is intentional and
changing the parameter type an acceptable solution.

Cheers

Matthias
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index dc7dfd68fafe..88d7cd9b6b0a 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;