All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Lodal <simonl@parknet.dk>
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH] realm: fix inversion
Date: Wed, 22 Sep 2004 03:48:40 +0200	[thread overview]
Message-ID: <4150D9F8.7060600@parknet.dk> (raw)


Make '--realm ! id' work as advertised.
Make save() output inversion correctly so it can be parsed back in, and 
work with iptables-restore and iptables-save.


Simon Lodal



diff -ruN iptables-1.2.11.orig/extensions/libipt_realm.c 
iptables-1.2.11.realm_inversion/extensions/libipt_realm.c
--- iptables-1.2.11.orig/extensions/libipt_realm.c	Wed Sep 22 03:14:48 2004
+++ iptables-1.2.11.realm_inversion/extensions/libipt_realm.c	Wed Sep 22 
01:37:06 2004
@@ -49,7 +49,8 @@
  	switch (c) {
  		char *end;
  	case '1':
-		check_inverse(optarg, &invert, &optind, 0);
+		if (check_inverse(optarg, &invert, &optind, 0))
+			optarg = argv[optind-1];
  		realminfo->id = strtoul(optarg, &end, 0);
  		if (*end == '/') {
  			realminfo->mask = strtoul(end+1, &end, 0);
@@ -72,7 +73,7 @@
  print_realm(unsigned long id, unsigned long mask, int invert, int numeric)
  {
  	if (invert)
-		fputc('!', stdout);
+		printf("! ");

  	if(mask != 0xffffffff)
  		printf("0x%lx/0x%lx ", id, mask);

             reply	other threads:[~2004-09-22  1:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-22  1:48 Simon Lodal [this message]
2004-09-22  1:58 ` [PATCH] realm: fix inversion Patrick McHardy
2004-09-22 12:32   ` Simon Lodal

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=4150D9F8.7060600@parknet.dk \
    --to=simonl@parknet.dk \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.