aboutsummaryrefslogtreecommitdiffstats
path: root/extensions/libxt_cpu.c
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2017-03-24 06:34:41 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-24 06:34:41 +0000
commit3c9546c0d95e649f59e239b9a20ef398eb553774 (patch)
tree4400fe0ba9baae676633293796954b4061726d5d /extensions/libxt_cpu.c
parent70bc36c5ebb934f094bd2135d0ff14280bcef024 (diff)
parente20d6bf62b07e455e15b3d8982fb83dc99b9e564 (diff)
downloadplatform_external_iptables-3c9546c0d95e649f59e239b9a20ef398eb553774.tar.gz
platform_external_iptables-3c9546c0d95e649f59e239b9a20ef398eb553774.tar.bz2
platform_external_iptables-3c9546c0d95e649f59e239b9a20ef398eb553774.zip
Merge changes from topic 'iptables-1.6.1' am: c784fc47e6 am: ff45753ae3
am: e20d6bf62b Change-Id: I7f42039a088b89201367df2b0a926fcd88987776
Diffstat (limited to 'extensions/libxt_cpu.c')
-rw-r--r--extensions/libxt_cpu.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/extensions/libxt_cpu.c b/extensions/libxt_cpu.c
index 404a6a66..41c13c3c 100644
--- a/extensions/libxt_cpu.c
+++ b/extensions/libxt_cpu.c
@@ -44,9 +44,19 @@ static void cpu_save(const void *ip, const struct xt_entry_match *match)
printf("%s --cpu %u", info->invert ? " !" : "", info->cpu);
}
+static int cpu_xlate(struct xt_xlate *xl,
+ const struct xt_xlate_mt_params *params)
+{
+ const struct xt_cpu_info *info = (void *)params->match->data;
+
+ xt_xlate_add(xl, "cpu%s %u", info->invert ? " !=" : "", info->cpu);
+
+ return 1;
+}
+
static struct xtables_match cpu_match = {
.family = NFPROTO_UNSPEC,
- .name = "cpu",
+ .name = "cpu",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_cpu_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_cpu_info)),
@@ -55,6 +65,7 @@ static struct xtables_match cpu_match = {
.save = cpu_save,
.x6_parse = cpu_parse,
.x6_options = cpu_opts,
+ .xlate = cpu_xlate,
};
void _init(void)