netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iprange: fix xt_iprange v0 parsing
@ 2010-04-21 12:09 Vincent Bernat
  2010-04-21 12:48 ` Patrick McHardy
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Bernat @ 2010-04-21 12:09 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Vincent Bernat

iprange_parse() was incomplete and did not include parsed ranges into
ipt_iprange_info structure resulting in always adding range
0.0.0.0-0.0.0.0 in the kernel.

Moreover, when using --dst-range, error messages may display
--src-range instead. Fix this too.

Signed-off-by: Vincent Bernat <bernat@luffy.cx>
---
 extensions/libxt_iprange.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/extensions/libxt_iprange.c b/extensions/libxt_iprange.c
index b28a635..55a2f84 100644
--- a/extensions/libxt_iprange.c
+++ b/extensions/libxt_iprange.c
@@ -108,7 +108,8 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
 		if (invert)
 			info->flags |= IPRANGE_SRC_INV;
 		iprange_parse_range(optarg, range, NFPROTO_IPV4, "--src-range");
-
+		info->src.min_ip = range[0].ip;
+		info->src.max_ip = range[1].ip;
 		break;
 
 	case '2':
@@ -122,8 +123,9 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
 		if (invert)
 			info->flags |= IPRANGE_DST_INV;
 
-		iprange_parse_range(optarg, range, NFPROTO_IPV4, "--src-range");
-
+		iprange_parse_range(optarg, range, NFPROTO_IPV4, "--dst-range");
+		info->dst.min_ip = range[0].ip;
+		info->dst.max_ip = range[1].ip;
 		break;
 
 	default:
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iprange: fix xt_iprange v0 parsing
  2010-04-21 12:09 [PATCH] iprange: fix xt_iprange v0 parsing Vincent Bernat
@ 2010-04-21 12:48 ` Patrick McHardy
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2010-04-21 12:48 UTC (permalink / raw)
  To: Vincent Bernat; +Cc: netfilter-devel

Vincent Bernat wrote:
> iprange_parse() was incomplete and did not include parsed ranges into
> ipt_iprange_info structure resulting in always adding range
> 0.0.0.0-0.0.0.0 in the kernel.
> 
> Moreover, when using --dst-range, error messages may display
> --src-range instead. Fix this too.

Applied, thanks Vincent.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-21 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21 12:09 [PATCH] iprange: fix xt_iprange v0 parsing Vincent Bernat
2010-04-21 12:48 ` Patrick McHardy

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).