|
|
4aca6e |
From 0401b1f92170a3c503e6dd1430b9b7cc0bcdbe47 Mon Sep 17 00:00:00 2001
|
|
|
4aca6e |
From: Phil Sutter <psutter@redhat.com>
|
|
|
4aca6e |
Date: Tue, 4 Apr 2017 16:24:00 +0200
|
|
|
4aca6e |
Subject: [PATCH] m_xt: whitespace cleanup
|
|
|
4aca6e |
|
|
|
4aca6e |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1326726
|
|
|
4aca6e |
Upstream Status: iproute2.git commit 4b83a08c280fc
|
|
|
4aca6e |
Conflicts: Changes in replaced code due to missing upstream commit
|
|
|
4aca6e |
32a121cba2579 ("tc: code cleanup").
|
|
|
4aca6e |
|
|
|
4aca6e |
commit 4b83a08c280fcd14ed8e775adc7604ea13c1252f
|
|
|
4aca6e |
Author: Stephen Hemminger <shemming@brocade.com>
|
|
|
4aca6e |
Date: Tue Jun 14 14:40:53 2016 -0700
|
|
|
4aca6e |
|
|
|
4aca6e |
m_xt: whitespace cleanup
|
|
|
4aca6e |
|
|
|
4aca6e |
Make it 99% checkpatch clean.
|
|
|
4aca6e |
---
|
|
|
4aca6e |
tc/m_xt.c | 32 +++++++++++++++++++++-----------
|
|
|
4aca6e |
1 file changed, 21 insertions(+), 11 deletions(-)
|
|
|
4aca6e |
|
|
|
4aca6e |
diff --git a/tc/m_xt.c b/tc/m_xt.c
|
|
|
4aca6e |
index c96d58c..8317f31 100644
|
|
|
4aca6e |
--- a/tc/m_xt.c
|
|
|
4aca6e |
+++ b/tc/m_xt.c
|
|
|
4aca6e |
@@ -39,8 +39,10 @@
|
|
|
4aca6e |
#endif
|
|
|
4aca6e |
|
|
|
4aca6e |
#ifndef __ALIGN_KERNEL
|
|
|
4aca6e |
-#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
|
|
|
4aca6e |
-#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
|
|
|
4aca6e |
+#define __ALIGN_KERNEL(x, a) \
|
|
|
4aca6e |
+ __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
|
|
|
4aca6e |
+#define __ALIGN_KERNEL_MASK(x, mask) \
|
|
|
4aca6e |
+ (((x) + (mask)) & ~(mask))
|
|
|
4aca6e |
#endif
|
|
|
4aca6e |
|
|
|
4aca6e |
#ifndef ALIGN
|
|
|
4aca6e |
@@ -51,7 +53,7 @@ static const char *tname = "mangle";
|
|
|
4aca6e |
|
|
|
4aca6e |
char *lib_dir;
|
|
|
4aca6e |
|
|
|
4aca6e |
-static const char *ipthooks[] = {
|
|
|
4aca6e |
+static const char * const ipthooks[] = {
|
|
|
4aca6e |
"NF_IP_PRE_ROUTING",
|
|
|
4aca6e |
"NF_IP_LOCAL_IN",
|
|
|
4aca6e |
"NF_IP_FORWARD",
|
|
|
4aca6e |
@@ -153,6 +155,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
|
|
|
4aca6e |
|
|
|
4aca6e |
/* copy tcipt_globals because .opts will be modified by iptables */
|
|
|
4aca6e |
struct xtables_globals tmp_tcipt_globals = tcipt_globals;
|
|
|
4aca6e |
+
|
|
|
4aca6e |
xtables_init_all(&tmp_tcipt_globals, NFPROTO_IPV4);
|
|
|
4aca6e |
set_lib_dir();
|
|
|
4aca6e |
|
|
|
4aca6e |
@@ -163,7 +166,8 @@ static int parse_ipt(struct action_util *a, int *argc_p,
|
|
|
4aca6e |
}
|
|
|
4aca6e |
|
|
|
4aca6e |
if (argc <= 2) {
|
|
|
4aca6e |
- fprintf(stderr, "too few arguments for xt, need at least '-j <target>'\n");
|
|
|
4aca6e |
+ fprintf(stderr,
|
|
|
4aca6e |
+ "too few arguments for xt, need at least '-j <target>'\n");
|
|
|
4aca6e |
return -1;
|
|
|
4aca6e |
}
|
|
|
4aca6e |
|
|
|
4aca6e |
@@ -175,7 +179,9 @@ static int parse_ipt(struct action_util *a, int *argc_p,
|
|
|
4aca6e |
case 'j':
|
|
|
4aca6e |
m = xtables_find_target(optarg, XTF_TRY_LOAD);
|
|
|
4aca6e |
if (!m) {
|
|
|
4aca6e |
- fprintf(stderr, " failed to find target %s\n\n", optarg);
|
|
|
4aca6e |
+ fprintf(stderr,
|
|
|
4aca6e |
+ " failed to find target %s\n\n",
|
|
|
4aca6e |
+ optarg);
|
|
|
4aca6e |
return -1;
|
|
|
4aca6e |
}
|
|
|
4aca6e |
|
|
|
4aca6e |
@@ -184,8 +190,11 @@ static int parse_ipt(struct action_util *a, int *argc_p,
|
|
|
4aca6e |
return -1;
|
|
|
4aca6e |
}
|
|
|
4aca6e |
|
|
|
4aca6e |
- if (get_xtables_target_opts(&tmp_tcipt_globals, m) < 0) {
|
|
|
4aca6e |
- fprintf(stderr, " failed to find additional options for target %s\n\n", optarg);
|
|
|
4aca6e |
+ if (get_xtables_target_opts(&tmp_tcipt_globals,
|
|
|
4aca6e |
+ m) < 0) {
|
|
|
4aca6e |
+ fprintf(stderr,
|
|
|
4aca6e |
+ " failed to find additional options for target %s\n\n",
|
|
|
4aca6e |
+ optarg);
|
|
|
4aca6e |
return -1;
|
|
|
4aca6e |
}
|
|
|
4aca6e |
ok++;
|
|
|
4aca6e |
@@ -198,10 +207,11 @@ static int parse_ipt(struct action_util *a, int *argc_p,
|
|
|
4aca6e |
#else
|
|
|
4aca6e |
if (m != NULL && m->parse != NULL) {
|
|
|
4aca6e |
m->parse(c - m->option_offset, argv, 0,
|
|
|
4aca6e |
- &m->tflags, NULL, &m->t);
|
|
|
4aca6e |
+ &m->tflags, NULL, &m->t);
|
|
|
4aca6e |
#endif
|
|
|
4aca6e |
} else {
|
|
|
4aca6e |
- fprintf(stderr,"failed to find target %s\n\n", optarg);
|
|
|
4aca6e |
+ fprintf(stderr,
|
|
|
4aca6e |
+ "failed to find target %s\n\n", optarg);
|
|
|
4aca6e |
return -1;
|
|
|
4aca6e |
|
|
|
4aca6e |
}
|
|
|
4aca6e |
@@ -296,7 +306,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
|
|
|
4aca6e |
}
|
|
|
4aca6e |
|
|
|
4aca6e |
static int
|
|
|
4aca6e |
-print_ipt(struct action_util *au,FILE * f, struct rtattr *arg)
|
|
|
4aca6e |
+print_ipt(struct action_util *au, FILE *f, struct rtattr *arg)
|
|
|
4aca6e |
{
|
|
|
4aca6e |
struct xtables_target *m;
|
|
|
4aca6e |
struct rtattr *tb[TCA_IPT_MAX + 1];
|
|
|
4aca6e |
@@ -348,7 +358,7 @@ print_ipt(struct action_util *au,FILE * f, struct rtattr *arg)
|
|
|
4aca6e |
|
|
|
4aca6e |
if (get_xtables_target_opts(&tmp_tcipt_globals, m) < 0) {
|
|
|
4aca6e |
fprintf(stderr,
|
|
|
4aca6e |
- " failed to find additional options for target %s\n\n",
|
|
|
4aca6e |
+ " failed to find additional options for target %s\n\n",
|
|
|
4aca6e |
t->u.user.name);
|
|
|
4aca6e |
return -1;
|
|
|
4aca6e |
}
|
|
|
4aca6e |
--
|
|
|
4aca6e |
1.8.3.1
|
|
|
4aca6e |
|