11 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
12 #include <linux/module.h>
13 #include <linux/types.h>
14 #include <linux/udp.h>
19 #include <linux/netfilter/x_tables.h>
20 #include <linux/netfilter_ipv4/ip_tables.h>
21 #include <linux/netfilter_ipv6/ip6_tables.h>
25 MODULE_DESCRIPTION(
"Xtables: multiple port matching for TCP, UDP, UDP-Lite, SCTP and DCCP");
37 for (i = 0; i < minfo->
count; i++) {
43 pr_debug(
"src or dst matches with %d-%d?\n", s, e);
46 && src >= s && src <= e)
47 return true ^ minfo->
invert;
49 && dst >= s && dst <= e)
50 return true ^ minfo->
invert;
52 && ((dst >= s && dst <= e)
53 || (src >= s && src <= e)))
54 return true ^ minfo->
invert;
57 pr_debug(
"src or dst matches with %d?\n", s);
61 return true ^ minfo->
invert;
64 return true ^ minfo->
invert;
66 && (src == s || dst == s))
67 return true ^ minfo->
invert;
84 pptr = skb_header_pointer(skb, par->
thoff,
sizeof(_ports), _ports);
89 pr_debug(
"Dropping evil offset=0 tinygram.\n");
94 return ports_match_v1(multiinfo,
ntohs(pptr[0]),
ntohs(pptr[1]));
137 .checkentry = multiport_mt_check,
138 .match = multiport_mt,
146 .checkentry = multiport_mt6_check,
147 .match = multiport_mt,
153 static int __init multiport_mt_init(
void)
159 static void __exit multiport_mt_exit(
void)