2 +++ b/include/linux/netfilter_ipv4/ipt_comment.h
4 +#ifndef _IPT_COMMENT_H
5 +#define _IPT_COMMENT_H
7 +#define IPT_MAX_COMMENT_LEN 256
9 +struct ipt_comment_info {
10 + char comment[IPT_MAX_COMMENT_LEN];
13 +#endif /* _IPT_COMMENT_H */
15 +++ b/net/ipv4/netfilter/ipt_comment.c
18 + * Implements a dummy match to allow attaching comments to rules
20 + * 2003-05-13 Brad Fisher (brad@info-link.net)
23 +#include <linux/module.h>
24 +#include <linux/skbuff.h>
25 +#include <linux/netfilter_ipv4/ip_tables.h>
26 +#include <linux/netfilter_ipv4/ipt_comment.h>
28 +MODULE_AUTHOR("Brad Fisher <brad@info-link.net>");
29 +MODULE_DESCRIPTION("iptables comment match module");
30 +MODULE_LICENSE("GPL");
33 +match(const struct sk_buff *skb,
34 + const struct net_device *in,
35 + const struct net_device *out,
36 + const void *matchinfo,
40 + /* We always match */
45 +checkentry(const char *tablename,
46 + const struct ipt_ip *ip,
48 + unsigned int matchsize,
49 + unsigned int hook_mask)
51 + /* Check the size */
52 + if (matchsize != IPT_ALIGN(sizeof(struct ipt_comment_info)))
57 +static struct ipt_match comment_match = {
60 + .checkentry = checkentry,
64 +static int __init init(void)
66 + return ipt_register_match(&comment_match);
69 +static void __exit fini(void)
71 + ipt_unregister_match(&comment_match);
76 --- a/net/ipv4/netfilter/Makefile
77 +++ b/net/ipv4/netfilter/Makefile
78 @@ -113,6 +113,7 @@ obj-$(CONFIG_IP_NF_MATCH_UNCLEAN) += ipt
79 obj-$(CONFIG_IP_NF_MATCH_STRING) += ipt_string.o
80 obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
81 obj-$(CONFIG_IP_NF_MATCH_LAYER7) += ipt_layer7.o
82 +obj-$(CONFIG_IP_NF_MATCH_COMMENT) += ipt_comment.o
85 obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
86 --- a/net/ipv4/netfilter/Config.in
87 +++ b/net/ipv4/netfilter/Config.in
88 @@ -44,6 +44,7 @@ if [ "$CONFIG_IP_NF_IPTABLES" != "n" ];
89 dep_tristate ' LENGTH match support' CONFIG_IP_NF_MATCH_LENGTH $CONFIG_IP_NF_IPTABLES
90 dep_tristate ' TTL match support' CONFIG_IP_NF_MATCH_TTL $CONFIG_IP_NF_IPTABLES
91 dep_tristate ' tcpmss match support' CONFIG_IP_NF_MATCH_TCPMSS $CONFIG_IP_NF_IPTABLES
92 + dep_tristate ' comment match support' CONFIG_IP_NF_MATCH_COMMENT $CONFIG_IP_NF_IPTABLES
93 if [ "$CONFIG_IP_NF_CONNTRACK" != "n" ]; then
94 dep_tristate ' Helper match support' CONFIG_IP_NF_MATCH_HELPER $CONFIG_IP_NF_IPTABLES