Commit 110d99ed authored by Jan Engelhardt's avatar Jan Engelhardt

netfilter: xtables: remove xt_multiport revision 0

Superseded by xt_multiport revision 1 (introduction already predates
linux.git).
Signed-off-by: default avatarJan Engelhardt <jengelh@medozas.de>
parent 779dd630
...@@ -26,23 +26,6 @@ MODULE_DESCRIPTION("Xtables: multiple port matching for TCP, UDP, UDP-Lite, SCTP ...@@ -26,23 +26,6 @@ MODULE_DESCRIPTION("Xtables: multiple port matching for TCP, UDP, UDP-Lite, SCTP
MODULE_ALIAS("ipt_multiport"); MODULE_ALIAS("ipt_multiport");
MODULE_ALIAS("ip6t_multiport"); MODULE_ALIAS("ip6t_multiport");
/* Returns 1 if the port is matched by the test, 0 otherwise. */
static inline bool
ports_match_v0(const u_int16_t *portlist, enum xt_multiport_flags flags,
u_int8_t count, u_int16_t src, u_int16_t dst)
{
unsigned int i;
for (i = 0; i < count; i++) {
if (flags != XT_MULTIPORT_DESTINATION && portlist[i] == src)
return true;
if (flags != XT_MULTIPORT_SOURCE && portlist[i] == dst)
return true;
}
return false;
}
/* Returns 1 if the port is matched by the test, 0 otherwise. */ /* Returns 1 if the port is matched by the test, 0 otherwise. */
static inline bool static inline bool
ports_match_v1(const struct xt_multiport_v1 *minfo, ports_match_v1(const struct xt_multiport_v1 *minfo,
...@@ -88,30 +71,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo, ...@@ -88,30 +71,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
return minfo->invert; return minfo->invert;
} }
static bool
multiport_mt_v0(const struct sk_buff *skb, const struct xt_match_param *par)
{
const __be16 *pptr;
__be16 _ports[2];
const struct xt_multiport *multiinfo = par->matchinfo;
if (par->fragoff != 0)
return false;
pptr = skb_header_pointer(skb, par->thoff, sizeof(_ports), _ports);
if (pptr == NULL) {
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
pr_debug("Dropping evil offset=0 tinygram.\n");
*par->hotdrop = true;
return false;
}
return ports_match_v0(multiinfo->ports, multiinfo->flags,
multiinfo->count, ntohs(pptr[0]), ntohs(pptr[1]));
}
static bool static bool
multiport_mt(const struct sk_buff *skb, const struct xt_match_param *par) multiport_mt(const struct sk_buff *skb, const struct xt_match_param *par)
{ {
...@@ -152,15 +111,6 @@ check(u_int16_t proto, ...@@ -152,15 +111,6 @@ check(u_int16_t proto,
&& count <= XT_MULTI_PORTS; && count <= XT_MULTI_PORTS;
} }
static int multiport_mt_check_v0(const struct xt_mtchk_param *par)
{
const struct ipt_ip *ip = par->entryinfo;
const struct xt_multiport *multiinfo = par->matchinfo;
return check(ip->proto, ip->invflags, multiinfo->flags,
multiinfo->count);
}
static int multiport_mt_check(const struct xt_mtchk_param *par) static int multiport_mt_check(const struct xt_mtchk_param *par)
{ {
const struct ipt_ip *ip = par->entryinfo; const struct ipt_ip *ip = par->entryinfo;
...@@ -170,15 +120,6 @@ static int multiport_mt_check(const struct xt_mtchk_param *par) ...@@ -170,15 +120,6 @@ static int multiport_mt_check(const struct xt_mtchk_param *par)
multiinfo->count); multiinfo->count);
} }
static int multiport_mt6_check_v0(const struct xt_mtchk_param *par)
{
const struct ip6t_ip6 *ip = par->entryinfo;
const struct xt_multiport *multiinfo = par->matchinfo;
return check(ip->proto, ip->invflags, multiinfo->flags,
multiinfo->count);
}
static int multiport_mt6_check(const struct xt_mtchk_param *par) static int multiport_mt6_check(const struct xt_mtchk_param *par)
{ {
const struct ip6t_ip6 *ip = par->entryinfo; const struct ip6t_ip6 *ip = par->entryinfo;
...@@ -189,15 +130,6 @@ static int multiport_mt6_check(const struct xt_mtchk_param *par) ...@@ -189,15 +130,6 @@ static int multiport_mt6_check(const struct xt_mtchk_param *par)
} }
static struct xt_match multiport_mt_reg[] __read_mostly = { static struct xt_match multiport_mt_reg[] __read_mostly = {
{
.name = "multiport",
.family = NFPROTO_IPV4,
.revision = 0,
.checkentry = multiport_mt_check_v0,
.match = multiport_mt_v0,
.matchsize = sizeof(struct xt_multiport),
.me = THIS_MODULE,
},
{ {
.name = "multiport", .name = "multiport",
.family = NFPROTO_IPV4, .family = NFPROTO_IPV4,
...@@ -207,15 +139,6 @@ static struct xt_match multiport_mt_reg[] __read_mostly = { ...@@ -207,15 +139,6 @@ static struct xt_match multiport_mt_reg[] __read_mostly = {
.matchsize = sizeof(struct xt_multiport_v1), .matchsize = sizeof(struct xt_multiport_v1),
.me = THIS_MODULE, .me = THIS_MODULE,
}, },
{
.name = "multiport",
.family = NFPROTO_IPV6,
.revision = 0,
.checkentry = multiport_mt6_check_v0,
.match = multiport_mt_v0,
.matchsize = sizeof(struct xt_multiport),
.me = THIS_MODULE,
},
{ {
.name = "multiport", .name = "multiport",
.family = NFPROTO_IPV6, .family = NFPROTO_IPV6,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment