diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-15 02:49:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:02:42 -0500 |
commit | c71e9167081a6a0d2a076cda674b696b89bb31c2 (patch) | |
tree | d10434bc658ba40a51a76ab6916154d2d8d73331 /net | |
parent | c56cc9c07b049acc9d2ca97be0b540978c0c80bf (diff) |
[NETFILTER]: nf_conntrack: make print_conntrack function optional for l4protos
Allows to remove five empty implementations.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 8 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 8 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_generic.c | 8 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_udp.c | 9 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_udplite.c | 9 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_standalone.c | 2 |
7 files changed, 2 insertions, 44 deletions
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c index acde9952cadf..543c02b74c96 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | |||
@@ -121,7 +121,7 @@ static int ct_seq_show(struct seq_file *s, void *v) | |||
121 | ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0) | 121 | ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0) |
122 | return -ENOSPC; | 122 | return -ENOSPC; |
123 | 123 | ||
124 | if (l4proto->print_conntrack(s, ct)) | 124 | if (l4proto->print_conntrack && l4proto->print_conntrack(s, ct)) |
125 | return -ENOSPC; | 125 | return -ENOSPC; |
126 | 126 | ||
127 | if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple, | 127 | if (print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple, |
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c index cd0d6690627e..4004a04c5510 100644 --- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c +++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c | |||
@@ -74,13 +74,6 @@ static int icmp_print_tuple(struct seq_file *s, | |||
74 | ntohs(tuple->src.u.icmp.id)); | 74 | ntohs(tuple->src.u.icmp.id)); |
75 | } | 75 | } |
76 | 76 | ||
77 | /* Print out the private part of the conntrack. */ | ||
78 | static int icmp_print_conntrack(struct seq_file *s, | ||
79 | const struct nf_conn *conntrack) | ||
80 | { | ||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | /* Returns verdict for packet, or -1 for invalid. */ | 77 | /* Returns verdict for packet, or -1 for invalid. */ |
85 | static int icmp_packet(struct nf_conn *ct, | 78 | static int icmp_packet(struct nf_conn *ct, |
86 | const struct sk_buff *skb, | 79 | const struct sk_buff *skb, |
@@ -309,7 +302,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp __read_mostly = | |||
309 | .pkt_to_tuple = icmp_pkt_to_tuple, | 302 | .pkt_to_tuple = icmp_pkt_to_tuple, |
310 | .invert_tuple = icmp_invert_tuple, | 303 | .invert_tuple = icmp_invert_tuple, |
311 | .print_tuple = icmp_print_tuple, | 304 | .print_tuple = icmp_print_tuple, |
312 | .print_conntrack = icmp_print_conntrack, | ||
313 | .packet = icmp_packet, | 305 | .packet = icmp_packet, |
314 | .new = icmp_new, | 306 | .new = icmp_new, |
315 | .error = icmp_error, | 307 | .error = icmp_error, |
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c index 02d60dfbab80..da924c6b5f06 100644 --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | |||
@@ -75,13 +75,6 @@ static int icmpv6_print_tuple(struct seq_file *s, | |||
75 | ntohs(tuple->src.u.icmp.id)); | 75 | ntohs(tuple->src.u.icmp.id)); |
76 | } | 76 | } |
77 | 77 | ||
78 | /* Print out the private part of the conntrack. */ | ||
79 | static int icmpv6_print_conntrack(struct seq_file *s, | ||
80 | const struct nf_conn *conntrack) | ||
81 | { | ||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | /* Returns verdict for packet, or -1 for invalid. */ | 78 | /* Returns verdict for packet, or -1 for invalid. */ |
86 | static int icmpv6_packet(struct nf_conn *ct, | 79 | static int icmpv6_packet(struct nf_conn *ct, |
87 | const struct sk_buff *skb, | 80 | const struct sk_buff *skb, |
@@ -275,7 +268,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly = | |||
275 | .pkt_to_tuple = icmpv6_pkt_to_tuple, | 268 | .pkt_to_tuple = icmpv6_pkt_to_tuple, |
276 | .invert_tuple = icmpv6_invert_tuple, | 269 | .invert_tuple = icmpv6_invert_tuple, |
277 | .print_tuple = icmpv6_print_tuple, | 270 | .print_tuple = icmpv6_print_tuple, |
278 | .print_conntrack = icmpv6_print_conntrack, | ||
279 | .packet = icmpv6_packet, | 271 | .packet = icmpv6_packet, |
280 | .new = icmpv6_new, | 272 | .new = icmpv6_new, |
281 | .error = icmpv6_error, | 273 | .error = icmpv6_error, |
diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c index 13f819179642..22c5dcb6306a 100644 --- a/net/netfilter/nf_conntrack_proto_generic.c +++ b/net/netfilter/nf_conntrack_proto_generic.c | |||
@@ -40,13 +40,6 @@ static int generic_print_tuple(struct seq_file *s, | |||
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | 42 | ||
43 | /* Print out the private part of the conntrack. */ | ||
44 | static int generic_print_conntrack(struct seq_file *s, | ||
45 | const struct nf_conn *state) | ||
46 | { | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | /* Returns verdict for packet, or -1 for invalid. */ | 43 | /* Returns verdict for packet, or -1 for invalid. */ |
51 | static int packet(struct nf_conn *conntrack, | 44 | static int packet(struct nf_conn *conntrack, |
52 | const struct sk_buff *skb, | 45 | const struct sk_buff *skb, |
@@ -104,7 +97,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_generic __read_mostly = | |||
104 | .pkt_to_tuple = generic_pkt_to_tuple, | 97 | .pkt_to_tuple = generic_pkt_to_tuple, |
105 | .invert_tuple = generic_invert_tuple, | 98 | .invert_tuple = generic_invert_tuple, |
106 | .print_tuple = generic_print_tuple, | 99 | .print_tuple = generic_print_tuple, |
107 | .print_conntrack = generic_print_conntrack, | ||
108 | .packet = packet, | 100 | .packet = packet, |
109 | .new = new, | 101 | .new = new, |
110 | #ifdef CONFIG_SYSCTL | 102 | #ifdef CONFIG_SYSCTL |
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c index 7ac607319562..384875411082 100644 --- a/net/netfilter/nf_conntrack_proto_udp.c +++ b/net/netfilter/nf_conntrack_proto_udp.c | |||
@@ -60,13 +60,6 @@ static int udp_print_tuple(struct seq_file *s, | |||
60 | ntohs(tuple->dst.u.udp.port)); | 60 | ntohs(tuple->dst.u.udp.port)); |
61 | } | 61 | } |
62 | 62 | ||
63 | /* Print out the private part of the conntrack. */ | ||
64 | static int udp_print_conntrack(struct seq_file *s, | ||
65 | const struct nf_conn *conntrack) | ||
66 | { | ||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | /* Returns verdict for packet, and may modify conntracktype */ | 63 | /* Returns verdict for packet, and may modify conntracktype */ |
71 | static int udp_packet(struct nf_conn *conntrack, | 64 | static int udp_packet(struct nf_conn *conntrack, |
72 | const struct sk_buff *skb, | 65 | const struct sk_buff *skb, |
@@ -193,7 +186,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly = | |||
193 | .pkt_to_tuple = udp_pkt_to_tuple, | 186 | .pkt_to_tuple = udp_pkt_to_tuple, |
194 | .invert_tuple = udp_invert_tuple, | 187 | .invert_tuple = udp_invert_tuple, |
195 | .print_tuple = udp_print_tuple, | 188 | .print_tuple = udp_print_tuple, |
196 | .print_conntrack = udp_print_conntrack, | ||
197 | .packet = udp_packet, | 189 | .packet = udp_packet, |
198 | .new = udp_new, | 190 | .new = udp_new, |
199 | .error = udp_error, | 191 | .error = udp_error, |
@@ -221,7 +213,6 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly = | |||
221 | .pkt_to_tuple = udp_pkt_to_tuple, | 213 | .pkt_to_tuple = udp_pkt_to_tuple, |
222 | .invert_tuple = udp_invert_tuple, | 214 | .invert_tuple = udp_invert_tuple, |
223 | .print_tuple = udp_print_tuple, | 215 | .print_tuple = udp_print_tuple, |
224 | .print_conntrack = udp_print_conntrack, | ||
225 | .packet = udp_packet, | 216 | .packet = udp_packet, |
226 | .new = udp_new, | 217 | .new = udp_new, |
227 | .error = udp_error, | 218 | .error = udp_error, |
diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c index 6518bcd17d65..070056d9bcd6 100644 --- a/net/netfilter/nf_conntrack_proto_udplite.c +++ b/net/netfilter/nf_conntrack_proto_udplite.c | |||
@@ -59,13 +59,6 @@ static int udplite_print_tuple(struct seq_file *s, | |||
59 | ntohs(tuple->dst.u.udp.port)); | 59 | ntohs(tuple->dst.u.udp.port)); |
60 | } | 60 | } |
61 | 61 | ||
62 | /* Print out the private part of the conntrack. */ | ||
63 | static int udplite_print_conntrack(struct seq_file *s, | ||
64 | const struct nf_conn *conntrack) | ||
65 | { | ||
66 | return 0; | ||
67 | } | ||
68 | |||
69 | /* Returns verdict for packet, and may modify conntracktype */ | 62 | /* Returns verdict for packet, and may modify conntracktype */ |
70 | static int udplite_packet(struct nf_conn *conntrack, | 63 | static int udplite_packet(struct nf_conn *conntrack, |
71 | const struct sk_buff *skb, | 64 | const struct sk_buff *skb, |
@@ -198,7 +191,6 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly = | |||
198 | .pkt_to_tuple = udplite_pkt_to_tuple, | 191 | .pkt_to_tuple = udplite_pkt_to_tuple, |
199 | .invert_tuple = udplite_invert_tuple, | 192 | .invert_tuple = udplite_invert_tuple, |
200 | .print_tuple = udplite_print_tuple, | 193 | .print_tuple = udplite_print_tuple, |
201 | .print_conntrack = udplite_print_conntrack, | ||
202 | .packet = udplite_packet, | 194 | .packet = udplite_packet, |
203 | .new = udplite_new, | 195 | .new = udplite_new, |
204 | .error = udplite_error, | 196 | .error = udplite_error, |
@@ -222,7 +214,6 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6 __read_mostly = | |||
222 | .pkt_to_tuple = udplite_pkt_to_tuple, | 214 | .pkt_to_tuple = udplite_pkt_to_tuple, |
223 | .invert_tuple = udplite_invert_tuple, | 215 | .invert_tuple = udplite_invert_tuple, |
224 | .print_tuple = udplite_print_tuple, | 216 | .print_tuple = udplite_print_tuple, |
225 | .print_conntrack = udplite_print_conntrack, | ||
226 | .packet = udplite_packet, | 217 | .packet = udplite_packet, |
227 | .new = udplite_new, | 218 | .new = udplite_new, |
228 | .error = udplite_error, | 219 | .error = udplite_error, |
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index d54ca78502c4..696074a037c1 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c | |||
@@ -142,7 +142,7 @@ static int ct_seq_show(struct seq_file *s, void *v) | |||
142 | ? (long)(conntrack->timeout.expires - jiffies)/HZ : 0) != 0) | 142 | ? (long)(conntrack->timeout.expires - jiffies)/HZ : 0) != 0) |
143 | return -ENOSPC; | 143 | return -ENOSPC; |
144 | 144 | ||
145 | if (l4proto->print_conntrack(s, conntrack)) | 145 | if (l4proto->print_conntrack && l4proto->print_conntrack(s, conntrack)) |
146 | return -ENOSPC; | 146 | return -ENOSPC; |
147 | 147 | ||
148 | if (print_tuple(s, &conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple, | 148 | if (print_tuple(s, &conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple, |