libxtables: add xtables_set_revision
Introduce xtables_set_revision() and make iptables and ip6tables use it.
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
diff --git a/xtables.c b/xtables.c
index d85e639..bc6a65e 100644
--- a/xtables.c
+++ b/xtables.c
@@ -108,6 +108,14 @@
}
}
+void xtables_set_revision(char *name, u_int8_t revision)
+{
+ /* Old kernel sources don't have ".revision" field,
+ * but we stole a byte from name. */
+ name[XT_FUNCTION_MAXNAMELEN - 2] = '\0';
+ name[XT_FUNCTION_MAXNAMELEN - 1] = revision;
+}
+
/**
* xtables_afinfo - protocol family dependent information
* @kmod: kernel module basename (e.g. "ip_tables")