: "any" matching in ipt_helper
PATCH 6/10 : "any" matching in ipt_helper
This patch for 2.4 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:38:11+02:00 [email protected]
# [NETFILTER]: "any" matching in ipt_helper
#
# net/ipv4/netfilter/ipt_helper.c # 2004/06/20 22:38:09+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:02:51 +02:00 +++ b/net/ipv4/netfilter/ipt_helper.c 2004-06-20 23:02:51 +02:00 @@ -67,8 +67,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;
@@ -88,10 +91,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;
}