Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194936
b: refs/heads/master
c: 110d99e
h: refs/heads/master
v: v3
  • Loading branch information
Jan Engelhardt committed Mar 25, 2010
1 parent 2d84c36 commit 1ab865d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 78 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 779dd630d8e198a2dc5581a48efae546161cc726
refs/heads/master: 110d99ed1c846458654e2771b3ad626319f19394
77 changes: 0 additions & 77 deletions trunk/net/netfilter/xt_multiport.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,6 @@ MODULE_DESCRIPTION("Xtables: multiple port matching for TCP, UDP, UDP-Lite, SCTP
MODULE_ALIAS("ipt_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. */
static inline bool
ports_match_v1(const struct xt_multiport_v1 *minfo,
Expand Down Expand Up @@ -88,30 +71,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
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
multiport_mt(const struct sk_buff *skb, const struct xt_match_param *par)
{
Expand Down Expand Up @@ -152,15 +111,6 @@ check(u_int16_t proto,
&& 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)
{
const struct ipt_ip *ip = par->entryinfo;
Expand All @@ -170,15 +120,6 @@ static int multiport_mt_check(const struct xt_mtchk_param *par)
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)
{
const struct ip6t_ip6 *ip = par->entryinfo;
Expand All @@ -189,15 +130,6 @@ static int multiport_mt6_check(const struct xt_mtchk_param *par)
}

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",
.family = NFPROTO_IPV4,
Expand All @@ -207,15 +139,6 @@ static struct xt_match multiport_mt_reg[] __read_mostly = {
.matchsize = sizeof(struct xt_multiport_v1),
.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",
.family = NFPROTO_IPV6,
Expand Down

0 comments on commit 1ab865d

Please sign in to comment.