1 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2 #include <linux/module.h>
9 #include <linux/netfilter/x_tables.h>
11 #include <linux/netfilter_ipv4/ip_tables.h>
12 #include <linux/netfilter_ipv6/ip6_tables.h>
20 #define SCCHECK(cond, option, flag, invflag) (!((flag) & (option)) \
21 || (!!((invflag) & (option)) ^ (cond)))
31 for (i = 0; i < flag_count; i++)
32 if (flag_info[i].chunktype == chunktype)
33 return (chunkflags & flag_info[i].flag_mask) == flag_info[
i].
flag;
59 sch = skb_header_pointer(skb, offset,
sizeof(_sch), &_sch);
60 if (sch ==
NULL || sch->length == 0) {
61 pr_debug(
"Dropping invalid SCTP packet.\n");
66 pr_debug(
"Chunk num: %d\toffset: %d\ttype: %d\tlength: %d"
68 ++i, offset, sch->type,
htons(sch->length),
73 pr_debug(
"skb->len: %d\toffset: %d\n", skb->
len, offset);
76 switch (chunk_match_type) {
78 if (match_flags(flag_info, flag_count,
79 sch->type, sch->flags)) {
85 if (match_flags(flag_info, flag_count,
86 sch->type, sch->flags))
91 if (!match_flags(flag_info, flag_count,
92 sch->type, sch->flags))
97 switch (chunk_match_type) {
104 switch (chunk_match_type) {
125 pr_debug(
"Dropping non-first fragment.. FIXME\n");
129 sh = skb_header_pointer(skb, par->
thoff,
sizeof(_sh), &_sh);
131 pr_debug(
"Dropping evil TCP offset=0 tinygram.\n");
170 .checkentry = sctp_mt_check,
179 .checkentry = sctp_mt_check,
187 static int __init sctp_mt_init(
void)
192 static void __exit sctp_mt_exit(
void)