[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201203051228.20049.hans.schillstrom@ericsson.com>
Date: Mon, 5 Mar 2012 12:28:18 +0100
From: Hans Schillstrom <hans.schillstrom@...csson.com>
To: Jan Engelhardt <jengelh@...ozas.de>
CC: Pablo Neira Ayuso <pablo@...filter.org>,
"kaber@...sh.net" <kaber@...sh.net>,
"netfilter-devel@...r.kernel.org" <netfilter-devel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"hans@...illstrom.com" <hans@...illstrom.com>
Subject: Re: [v9 PATCH 2/3] NETFILTER module xt_hmark, new target for HASH based fwmark
On Monday 05 March 2012 11:48:16 Jan Engelhardt wrote:
>
> On Monday 2012-03-05 11:09, Hans Schillstrom wrote:
> >> > diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
> >> > index 40f4c3d..21bc5e8 100644
> >> > --- a/net/netfilter/Makefile
> >> > +++ b/net/netfilter/Makefile
> >> > @@ -57,6 +57,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o
> >> > obj-$(CONFIG_NETFILTER_XT_TARGET_CT) += xt_CT.o
> >> > obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o
> >> > obj-$(CONFIG_NETFILTER_XT_TARGET_HL) += xt_HL.o
> >> > +obj-$(CONFIG_NETFILTER_XT_TARGET_HMARK) += xt_hmark.o
> >>
> >> Netfilter's naming policy requires that targets are in upper case.
> >
> >I asked netfilter team about that, and got the answer
> >that it should be lower case for new modules.
> >Have that been changed ?
>
> The name of the file is pretty much irrelevant (because loading
> solely depends on MODULE_ALIAS), so I share that only lowercase
> should be used for new things. It's not that the linux kernel would
> currently be storable on a case-insensitive filesystem, but that does
> not mean we can't latently work towards it.
OK
> >static int get_inner_hdr(struct sk_buff *skb, int *nhoff)
> >{
> > const struct icmphdr *icmph;
> > struct icmphdr _ih;
> > int iphz = ((struct iphdr *)skb_network_header(skb))->ihl * 4;
>
> unsigned int iphz = skb_hdrlen(skb);
>
> >> > +static unsigned int
> >> > +hmark_v6(struct sk_buff *skb, const struct xt_action_param *par)
> >> > +{
> >> > + struct xt_hmark_info *info = (struct xt_hmark_info *)par->targinfo;
>
> Pointless cast.
Yes, better to add a const in front of struct hmark
>
> >> > + union hmark_ports uports = { .v32 = 0 };
> >>
> >> I think that this can be: union hmark_ports uports = {};
>
> NB: Strictly speaking, {} is a GNU extension to saying {0} (or {{0}} or
> {{{{{0}}}}} etc, which ever applies).
Thanks, but I still don't think "= {}"; is obvious what it does :-)
It kan be nice if you have a lot to clear;
>
> >> > +static unsigned int
> >> > +hmark_v4(struct sk_buff *skb, const struct xt_action_param *par)
> >> > +{
> >> > + struct xt_hmark_info *info = (struct xt_hmark_info *)par->targinfo;
>
> Same pointless cast.
>
--
Thanks
Hans
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists