: "any" matching in ipt_helper
PATCH 6/14 : "any" matching in ipt_helper
This patch for 2.6 changes ipt_helper to recognize the empty string as a wildcard.
Author: Patrick McHardy <[email protected]>
--
- Harald Welte <[email protected]> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/06/20 22:37:32+02:00 [email protected]
# [NETFILTER]: "any" matching in ipt_helper
#
# net/ipv4/netfilter/ipt_helper.c # 2004/06/20 22:37:23+02:00 [email protected] +5 -6 # [NETFILTER]: "any" matching in ipt_helper # diff -Nru a/net/ipv4/netfilter/ipt_helper.c b/net/ipv4/netfilter/ipt_helper.c --- a/net/ipv4/netfilter/ipt_helper.c 2004-06-20 23:00:11 +02:00 +++ b/net/ipv4/netfilter/ipt_helper.c 2004-06-20 23:00:11 +02:00 @@ -71,8 +71,11 @@ DEBUGP("master's name = %s , info->name = %s\n", exp->expectant->helper->name, info->name);
- ret ^= !strncmp(exp->expectant->helper->name, info->name,
- strlen(exp->expectant->helper->name));
+ if (info->name[0] == '\0')
+ ret ^= 1;
+ else
+ ret ^= !strncmp(exp->expectant->helper->name, info->name,
+ strlen(exp->expectant->helper->name));
out_unlock:
READ_UNLOCK(&ip_conntrack_lock);
return ret;
@@ -92,10 +95,6 @@
if (matchsize != IPT_ALIGN(sizeof(struct ipt_helper_info)))
return 0;
- /* verify that we actually should match anything */
- if ( strlen(info->name) == 0 )
- return 0;
-
return 1;
}