summaryrefslogtreecommitdiffstats
path: root/iptables/iptables.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@inai.de>2012-09-27 23:48:25 +0200
committerJan Engelhardt <jengelh@inai.de>2012-09-29 23:14:44 +0200
commitc436dad7cfdd80ca4a05ceed556c39babc266f55 (patch)
tree7b91b28f5ef3f735e18c08fbcf7beeb1eae5fe1f /iptables/iptables.c
parent50f19190a60ff7d69e88406a71a2f27e09008566 (diff)
iptables: support for match aliases
This patch allows for match names listed on the command line to be rewritten to new names and revisions, like we did for targets before. Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Diffstat (limited to 'iptables/iptables.c')
-rw-r--r--iptables/iptables.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/iptables/iptables.c b/iptables/iptables.c
index a237e93c..5786bfdd 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -1330,8 +1330,12 @@ static void command_match(struct iptables_command_state *cs)
size = XT_ALIGN(sizeof(struct xt_entry_match)) + m->size;
m->m = xtables_calloc(1, size);
m->m->u.match_size = size;
- strcpy(m->m->u.user.name, m->name);
+ strcpy(m->m->u.user.name, m->real_name);
m->m->u.user.revision = m->revision;
+ if (m->real_name != m->name)
+ fprintf(stderr, "WARNING: The %s match is obsolete. "
+ "Use %s instead.\n", m->name, m->real_name);
+
xs_init_match(m);
if (m == m->next)
return;