From: Hannes Eder <heder@google.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 5/5] libxt_ipvs: user space lib for netfilter matcher xt_ipvs
Date: Tue, 28 Jul 2009 14:34:26 +0200 [thread overview]
Message-ID: <b5ddba180907280534l78eaf951j53048ebfbef4258c@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.0907272037500.20984@fbirervta.pbzchgretzou.qr>
On Mon, Jul 27, 2009 at 20:40, Jan Engelhardt<jengelh@medozas.de> wrote:
>
> On Monday 2009-07-27 15:48, Hannes Eder wrote:
>>+
>>+ switch (c) {
>>+ case '0': /* --ipvs */
>>+ /* Nothing to do here. */
>
> Then why add it?
In the 'default' branch is an assert(false); Call it defensive programming.
>>+ char buf[BUFSIZ];
>>+
>>+ if (family == NFPROTO_IPV4) {
>>+ if (!numeric && addr->ip == 0) {
>>+ printf("anywhere ");
>>+ return;
>>+ }
>>+ if (numeric)
>>+ strcpy(buf, xtables_ipaddr_to_numeric(&addr->in));
>>+ else
>>+ strcpy(buf, xtables_ipaddr_to_anyname(&addr->in));
>>+ strcat(buf, xtables_ipmask_to_numeric(&mask->in));
>>+ printf("%s ", buf);
>
> There is no need to use the strcpy/strcat hacks. Just directly printf it.
As the comment says: "Shamelessly copied from libxt_conntrack.c". ;)
Furthermore I think it is good that way, because
xtables_ipaddr_to_numeric writes to a local static buffer, and
xtables_ipaddr_to_numeric might get called by
xtables_ipmask_to_numeric.
>>--- /dev/null
>>+++ b/extensions/libxt_ipvs.man
>>@@ -0,0 +1,7 @@
>>+ipvs tests where the packet was modified by IPVS, i.e. is the
>>+skb_buff->ipvs_property set.
>>+.TP
>>+[\fB!\fP] \fB--ipvs
>>+Does the packet have to IPVS property?
>>+
>>+TODO: Write proper documentation.
>
> Yes.
Sir, yes, sir ;) I am working on that.
Thanks,
-Hannes
--
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
prev parent reply other threads:[~2009-07-28 12:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-27 13:46 [RFC][PATCH 0/5] IPVS full NAT support + netfilter 'ipvs' match support Hannes Eder
2009-07-27 13:46 ` [RFC][PATCH 1/5] IPVS: prefix EnterFunction and LeaveFunction msg with "IPVS:" Hannes Eder
2009-07-27 18:14 ` Jan Engelhardt
2009-07-28 11:15 ` Hannes Eder
2009-07-27 13:46 ` [RFC][PATCH 2/5] netfilter: xt_ipvs (netfilter matcher for ipvs) Hannes Eder
2009-07-27 18:35 ` Jan Engelhardt
2009-07-28 14:55 ` Hannes Eder
2009-07-27 13:46 ` [RFC][PATCH 3/5] IPVS: make friends with nf_conntrack Hannes Eder
2009-07-27 13:46 ` [RFC][PATCH 4/5] IPVS: debugging output for ip_vs_update_conntrack Hannes Eder
2009-07-27 13:48 ` [RFC][PATCH 5/5] libxt_ipvs: user space lib for netfilter matcher xt_ipvs Hannes Eder
2009-07-27 18:40 ` Jan Engelhardt
2009-07-28 12:34 ` Hannes Eder [this message]
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=b5ddba180907280534l78eaf951j53048ebfbef4258c@mail.gmail.com \
--to=heder@google.com \
--cc=jengelh@medozas.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lvs-devel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).