[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1279906219.2481.94.camel@edumazet-laptop>
Date: Fri, 23 Jul 2010 19:30:19 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jan Engelhardt <jengelh@...ozas.de>
Cc: Patrick McHardy <kaber@...sh.net>,
Netfilter Development Mailinglist
<netfilter-devel@...r.kernel.org>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH iptables] extension: add xt_cpu match
Le vendredi 23 juillet 2010 à 18:46 +0200, Jan Engelhardt a écrit :
> On Friday 2010-07-23 15:43, Eric Dumazet wrote:
> >+
> >+static const struct option cpu_opts[] = {
> >+ { "cpu", 1, NULL, '1' },
> >+ { .name = NULL }
> >+};
>
> I will never understand that sort of style mix logic. Why the
> C99 initializer only on the sentinel?
>
> {
> {.name = "cpu", .has_arg = true, .val = '1'},
> {NULL},
> };
>
copy/paste from another module ?
> >+cpu_print(const void *ip, const struct xt_entry_match *match, int numeric)
> >+{
> >+ const struct xt_cpu_info *info = (void *)match->data;
> >+
> >+ printf("cpu %s%u ", info->invert ? "! ":"", info->cpu);
> >+}
> >+
> >+static void cpu_save(const void *ip, const struct xt_entry_match *match)
> >+{
> >+ const struct xt_cpu_info *info = (void *)match->data;
> >+
> >+ printf("%s--cpu %u ", info->invert ? "! ":"", info->cpu);
> >+}
>
> Using if (info->invert) would save the empty string.
>
Not sure what you mean. You want to save an empty string (1 byte long),
and add multiple printf() calls ?
> >diff --git a/extensions/libxt_cpu.man b/extensions/libxt_cpu.man
> >index e69de29..f42ac7a 100644
> >--- a/extensions/libxt_cpu.man
> >+++ b/extensions/libxt_cpu.man
> >@@ -0,0 +1,16 @@
> >+.TP
> >+[\fB!\fP] \fB\-\-cpu\fP \fInumber\fP
> >+
> >+Match cpu handling this packet. cpus are numbered from 0 to NR_CPUS-1
>
> Unwanted blank line.
>
> >+Can be used in combination with RPS (Remote Packet Steering) or
> >+multiqueue NICS to spread network traffic on different queues.
> >+.PP
> >+Example:
> >+.PP
> >+iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 0
> >+ \-j REDIRECT \-\-to\-port 8080
>
> Unwanted indent.
>
> >+.PP
> >+iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 1
> >+ \-j REDIRECT \-\-to\-port 8081
> >+.PP
> >+Available since linux 2.6.36
>
> Linux.
OK ;)
I'll provide a cleanup patch, not only to xt_cpu but all other iptables
modules that dont meet your coding style requirements ;)
Thanks
--
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