12 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13 #include <linux/module.h>
16 #include <linux/netfilter/x_tables.h>
33 return ((kaddr->
ip ^ uaddr->
ip) & umask->
ip) == 0;
35 return ipv6_masked_addr_cmp(&kaddr->
in6, &umask->
in6,
42 conntrack_mt_origsrc(
const struct nf_conn *
ct,
51 conntrack_mt_origdst(
const struct nf_conn *
ct,
60 conntrack_mt_replsrc(
const struct nf_conn *
ct,
69 conntrack_mt_repldst(
const struct nf_conn *
ct,
85 (nf_ct_protonum(ct) == info->
l4proto) ^
118 return (port >= min && port <= max) ^ invert;
129 (nf_ct_protonum(ct) == info->
l4proto) ^
165 u16 state_mask,
u16 status_mask)
170 unsigned int statebit;
172 ct = nf_ct_get(skb, &ctinfo);
175 if (nf_ct_is_untracked(ct))
189 if (!!(state_mask & statebit) ^
202 if (conntrack_mt_origsrc(ct, info, par->
family) ^
207 if (conntrack_mt_origdst(ct, info, par->
family) ^
212 if (conntrack_mt_replsrc(ct, info, par->
family) ^
217 if (conntrack_mt_repldst(ct, info, par->
family) ^
221 if (par->
match->revision != 3) {
222 if (!ct_proto_port_check(info, ct))
225 if (!ct_proto_port_check_v3(par->
matchinfo, ct))
230 (!!(status_mask & ct->
status) ^
235 unsigned long expires = 0;
237 if (timer_pending(&ct->
timeout))
240 expires <= info->expires_max) ^
277 pr_info(
"cannot load conntrack support for proto=%u\n",
293 .
match = conntrack_mt_v1,
294 .checkentry = conntrack_mt_check,
295 .destroy = conntrack_mt_destroy,
303 .
match = conntrack_mt_v2,
304 .checkentry = conntrack_mt_check,
305 .destroy = conntrack_mt_destroy,
313 .
match = conntrack_mt_v3,
314 .checkentry = conntrack_mt_check,
315 .destroy = conntrack_mt_destroy,
320 static int __init conntrack_mt_init(
void)
326 static void __exit conntrack_mt_exit(
void)