aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/iptables/patches/500-add-xt_id-match.patch
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2016-01-24 18:01:40 +0000
committerJo-Philipp Wich <jow@openwrt.org>2016-01-24 18:01:40 +0000
commitd60fdb4329a583f8edc43811af48b6a5d0d7b850 (patch)
treef061a9c93b70bf2d341a64d4fe7dd41fa3ce687c /package/network/utils/iptables/patches/500-add-xt_id-match.patch
parentef283ba4ed2a712c9199c0b6349d39535d7a1e06 (diff)
downloadmaster-187ad058-d60fdb4329a583f8edc43811af48b6a5d0d7b850.tar.gz
master-187ad058-d60fdb4329a583f8edc43811af48b6a5d0d7b850.tar.bz2
master-187ad058-d60fdb4329a583f8edc43811af48b6a5d0d7b850.zip
iptables: improve iptables listing output of xt_id match
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48478 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/utils/iptables/patches/500-add-xt_id-match.patch')
-rw-r--r--package/network/utils/iptables/patches/500-add-xt_id-match.patch14
1 files changed, 12 insertions, 2 deletions
diff --git a/package/network/utils/iptables/patches/500-add-xt_id-match.patch b/package/network/utils/iptables/patches/500-add-xt_id-match.patch
index 94762f0ab7..0964f0175f 100644
--- a/package/network/utils/iptables/patches/500-add-xt_id-match.patch
+++ b/package/network/utils/iptables/patches/500-add-xt_id-match.patch
@@ -1,6 +1,6 @@
--- /dev/null
+++ b/extensions/libxt_id.c
-@@ -0,0 +1,45 @@
+@@ -0,0 +1,55 @@
+/* Shared library add-on to iptables to add id match support. */
+
+#include <stdio.h>
@@ -22,13 +22,22 @@
+ XTOPT_TABLEEND,
+};
+
++static void
++id_print(const void *ip, const struct xt_entry_match *match, int numeric)
++{
++ struct xt_id_info *idinfo = (void *)match->data;
++
++ printf(" ID:%08lx", idinfo->id);
++}
++
++
+/* Saves the union ipt_matchinfo in parsable form to stdout. */
+static void
+id_save(const void *ip, const struct xt_entry_match *match)
+{
+ struct xt_id_info *idinfo = (void *)match->data;
+
-+ printf(" --id %lu", idinfo->id);
++ printf(" --id 0x%lx", idinfo->id);
+}
+
+static struct xtables_match id_match = {
@@ -37,6 +46,7 @@
+ .version = XTABLES_VERSION,
+ .size = XT_ALIGN(sizeof(struct xt_id_info)),
+ .userspacesize = XT_ALIGN(sizeof(struct xt_id_info)),
++ .print = id_print,
+ .save = id_save,
+ .x6_parse = xtables_option_parse,
+ .x6_options = id_opts,