netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Eastep <teastep@shorewall.net>
To: Netfilter Development <netfilter-devel@vger.kernel.org>
Subject: PATCH - Fix for --random option in DNAT and REDIRECT
Date: Wed, 14 Nov 2007 13:09:01 -0800	[thread overview]
Message-ID: <473B63ED.7020307@shorewall.net> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 364 bytes --]

The --random option produces "Unknown arg `--random'" errors with both the
DNAT and REDIRECT targets. Corrected by the attached patch.

-Tom
-- 
Tom Eastep    \ Nothing is foolproof to a sufficiently talented fool
Shoreline,     \ http://shorewall.net
Washington USA  \ teastep@shorewall.net
PGP Public Key   \ https://lists.shorewall.net/teastep.pgp.key

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: random-patch.diff --]
[-- Type: text/x-diff; name="random-patch.diff", Size: 894 bytes --]

diff -au ../iptables-1.3.8.standard/extensions/libipt_DNAT.c extensions/libipt_DNAT.c
--- ../iptables-1.3.8.standard/extensions/libipt_DNAT.c	2007-06-24 16:26:35.000000000 -0700
+++ extensions/libipt_DNAT.c	2007-11-14 12:56:40.000000000 -0800
@@ -180,6 +180,7 @@
 			*flags |= IPT_DNAT_OPT_RANDOM;
 		} else
 			*flags |= IPT_DNAT_OPT_RANDOM;
+		return 1;
 	default:
 		return 0;
 	}
Only in extensions/: libipt_DNAT.c~
diff -au ../iptables-1.3.8.standard/extensions/libipt_REDIRECT.c extensions/libipt_REDIRECT.c
--- ../iptables-1.3.8.standard/extensions/libipt_REDIRECT.c	2007-06-24 16:26:35.000000000 -0700
+++ extensions/libipt_REDIRECT.c	2007-11-14 12:56:20.000000000 -0800
@@ -24,7 +24,7 @@
 
 static struct option opts[] = {
 	{ "to-ports", 1, 0, '1' },
-	{ "random", 1, 0, '2' },
+	{ "random", 0, 0, '2' },
 	{ 0 }
 };
 
Only in extensions/: libipt_REDIRECT.c~

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

             reply	other threads:[~2007-11-14 21:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14 21:09 Tom Eastep [this message]
2007-11-15 12:59 ` PATCH - Fix for --random option in DNAT and REDIRECT Patrick McHardy

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=473B63ED.7020307@shorewall.net \
    --to=teastep@shorewall.net \
    --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).