lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b5ddba180907280534l78eaf951j53048ebfbef4258c@mail.gmail.com>
Date:	Tue, 28 Jul 2009 14:34:26 +0200
From:	Hannes Eder <heder@...gle.com>
To:	Jan Engelhardt <jengelh@...ozas.de>
Cc:	lvs-devel@...r.kernel.org, netdev@...r.kernel.org,
	netfilter-devel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 5/5] libxt_ipvs: user space lib for netfilter matcher 
	xt_ipvs

On Mon, Jul 27, 2009 at 20:40, Jan Engelhardt<jengelh@...ozas.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 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ