All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephane Ouellette <ouellettes@videotron.ca>
To: Harald Welte <laforge@netfilter.org>
Cc: Netfilter Mailing List <netfilter-devel@lists.netfilter.org>
Subject: [PATCH]  libip6t_MARK.c
Date: Fri, 05 Sep 2003 02:42:04 -0400	[thread overview]
Message-ID: <3F58303C.3030508@videotron.ca> (raw)

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

Harald,

    here's another userspace patch:

1- remove unused struct markinfo,
2- print_mark() was only used once, so I removed it and changed print() 
accordingly,
3- C99 initializers.

Please apply,

Stephane


[-- Attachment #2: libip6t_MARK.c.patch --]
[-- Type: text/plain, Size: 1961 bytes --]

--- netfilter.orig/userspace/extensions/libip6t_MARK.c	Wed May 29 09:08:15 2002
+++ netfilter/userspace/extensions/libip6t_MARK.c	Mon Aug 11 21:09:59 2003
@@ -8,11 +8,6 @@
 #include <linux/netfilter_ipv6/ip6_tables.h>
 #include <linux/netfilter_ipv6/ip6t_MARK.h>
 
-struct markinfo {
-	struct ip6t_entry_target t;
-	struct ip6t_mark_target_info mark;
-};
-
 /* Function which prints out usage message. */
 static void
 help(void)
@@ -25,8 +20,8 @@
 }
 
 static struct option opts[] = {
-	{ "set-mark", 1, 0, '1' },
-	{ 0 }
+	{ .name = "set-mark", .has_arg = 1, .flag = 0, .val = '1' },
+	{ .name = 0 }
 };
 
 /* Initialize the target. */
@@ -72,12 +67,6 @@
 		           "MARK target: Parameter --set-mark is required");
 }
 
-static void
-print_mark(unsigned long mark, int numeric)
-{
-	printf("0x%lx ", mark);
-}
-
 /* Prints out the targinfo. */
 static void
 print(const struct ip6t_ip6 *ip,
@@ -86,8 +75,8 @@
 {
 	const struct ip6t_mark_target_info *markinfo =
 		(const struct ip6t_mark_target_info *)target->data;
-	printf("MARK set ");
-	print_mark(markinfo->mark, numeric);
+
+	printf("MARK set 0x%lx ", markinfo->mark);
 }
 
 /* Saves the union ipt_targinfo in parsable form to stdout. */
@@ -101,19 +90,18 @@
 }
 
 static
-struct ip6tables_target mark
-= { NULL,
-    "MARK",
-    IPTABLES_VERSION,
-    IP6T_ALIGN(sizeof(struct ip6t_mark_target_info)),
-    IP6T_ALIGN(sizeof(struct ip6t_mark_target_info)),
-    &help,
-    &init,
-    &parse,
-    &final_check,
-    &print,
-    &save,
-    opts
+struct ip6tables_target mark = {
+	.name          = "MARK",
+	.version       = IPTABLES_VERSION,
+	.size          = IP6T_ALIGN(sizeof(struct ip6t_mark_target_info)),
+	.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_mark_target_info)),
+	.help          = &help,
+	.init          = &init,
+	.parse         = &parse,
+	.final_check   = &final_check,
+	.print         = &print,
+	.save          = &save,
+	.extra_opts    = opts
 };
 
 void _init(void)

             reply	other threads:[~2003-09-05  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-05  6:42 Stephane Ouellette [this message]
2003-09-05 12:55 ` [PATCH] libip6t_MARK.c Harald Welte

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=3F58303C.3030508@videotron.ca \
    --to=ouellettes@videotron.ca \
    --cc=laforge@netfilter.org \
    --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.