aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/netfilter/xt_multiport.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/net/netfilter/xt_multiport.c b/net/netfilter/xt_multiport.c
index b446738eab1a..83b77ceb264f 100644
--- a/net/netfilter/xt_multiport.c
+++ b/net/netfilter/xt_multiport.c
@@ -28,23 +28,6 @@ MODULE_ALIAS("ip6t_multiport");
28 28
29/* Returns 1 if the port is matched by the test, 0 otherwise. */ 29/* Returns 1 if the port is matched by the test, 0 otherwise. */
30static inline bool 30static inline bool
31ports_match_v0(const u_int16_t *portlist, enum xt_multiport_flags flags,
32 u_int8_t count, u_int16_t src, u_int16_t dst)
33{
34 unsigned int i;
35 for (i = 0; i < count; i++) {
36 if (flags != XT_MULTIPORT_DESTINATION && portlist[i] == src)
37 return true;
38
39 if (flags != XT_MULTIPORT_SOURCE && portlist[i] == dst)
40 return true;
41 }
42
43 return false;
44}
45
46/* Returns 1 if the port is matched by the test, 0 otherwise. */
47static inline bool
48ports_match_v1(const struct xt_multiport_v1 *minfo, 31ports_match_v1(const struct xt_multiport_v1 *minfo,
49 u_int16_t src, u_int16_t dst) 32 u_int16_t src, u_int16_t dst)
50{ 33{
@@ -89,30 +72,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
89} 72}
90 73
91static bool 74static bool
92multiport_mt_v0(const struct sk_buff *skb, const struct xt_match_param *par)
93{
94 const __be16 *pptr;
95 __be16 _ports[2];
96 const struct xt_multiport *multiinfo = par->matchinfo;
97
98 if (par->fragoff != 0)
99 return false;
100
101 pptr = skb_header_pointer(skb, par->thoff, sizeof(_ports), _ports);
102 if (pptr == NULL) {
103 /* We've been asked to examine this packet, and we
104 * can't. Hence, no choice but to drop.
105 */
106 pr_debug("Dropping evil offset=0 tinygram.\n");
107 *par->hotdrop = true;
108 return false;
109 }
110
111 return ports_match_v0(multiinfo->ports, multiinfo->flags,
112 multiinfo->count, ntohs(pptr[0]), ntohs(pptr[1]));
113}
114
115static bool
116multiport_mt(const struct sk_buff *skb, const struct xt_match_param *par) 75multiport_mt(const struct sk_buff *skb, const struct xt_match_param *par)
117{ 76{
118 const __be16 *pptr; 77 const __be16 *pptr;
@@ -152,15 +111,6 @@ check(u_int16_t proto,
152 && count <= XT_MULTI_PORTS; 111 && count <= XT_MULTI_PORTS;
153} 112}
154 113
155static int multiport_mt_check_v0(const struct xt_mtchk_param *par)
156{
157 const struct ipt_ip *ip = par->entryinfo;
158 const struct xt_multiport *multiinfo = par->matchinfo;
159
160 return check(ip->proto, ip->invflags, multiinfo->flags,
161 multiinfo->count);
162}
163
164static int multiport_mt_check(const struct xt_mtchk_param *par) 114static int multiport_mt_check(const struct xt_mtchk_param *par)
165{ 115{
166 const struct ipt_ip *ip = par->entryinfo; 116 const struct ipt_ip *ip = par->entryinfo;
@@ -170,15 +120,6 @@ static int multiport_mt_check(const struct xt_mtchk_param *par)
170 multiinfo->count); 120 multiinfo->count);
171} 121}
172 122
173static int multiport_mt6_check_v0(const struct xt_mtchk_param *par)
174{
175 const struct ip6t_ip6 *ip = par->entryinfo;
176 const struct xt_multiport *multiinfo = par->matchinfo;
177
178 return check(ip->proto, ip->invflags, multiinfo->flags,
179 multiinfo->count);
180}
181
182static int multiport_mt6_check(const struct xt_mtchk_param *par) 123static int multiport_mt6_check(const struct xt_mtchk_param *par)
183{ 124{
184 const struct ip6t_ip6 *ip = par->entryinfo; 125 const struct ip6t_ip6 *ip = par->entryinfo;
@@ -192,15 +133,6 @@ static struct xt_match multiport_mt_reg[] __read_mostly = {
192 { 133 {
193 .name = "multiport", 134 .name = "multiport",
194 .family = NFPROTO_IPV4, 135 .family = NFPROTO_IPV4,
195 .revision = 0,
196 .checkentry = multiport_mt_check_v0,
197 .match = multiport_mt_v0,
198 .matchsize = sizeof(struct xt_multiport),
199 .me = THIS_MODULE,
200 },
201 {
202 .name = "multiport",
203 .family = NFPROTO_IPV4,
204 .revision = 1, 136 .revision = 1,
205 .checkentry = multiport_mt_check, 137 .checkentry = multiport_mt_check,
206 .match = multiport_mt, 138 .match = multiport_mt,
@@ -210,15 +142,6 @@ static struct xt_match multiport_mt_reg[] __read_mostly = {
210 { 142 {
211 .name = "multiport", 143 .name = "multiport",
212 .family = NFPROTO_IPV6, 144 .family = NFPROTO_IPV6,
213 .revision = 0,
214 .checkentry = multiport_mt6_check_v0,
215 .match = multiport_mt_v0,
216 .matchsize = sizeof(struct xt_multiport),
217 .me = THIS_MODULE,
218 },
219 {
220 .name = "multiport",
221 .family = NFPROTO_IPV6,
222 .revision = 1, 145 .revision = 1,
223 .checkentry = multiport_mt6_check, 146 .checkentry = multiport_mt6_check,
224 .match = multiport_mt, 147 .match = multiport_mt,