aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_connlimit.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-10-08 05:35:01 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:01 -0400
commitee999d8b9573df1b547aacdc6d79f86eb79c25cd (patch)
tree83585a40918ad1ebad17f4a0cfbf5486c02c64d7 /net/netfilter/xt_connlimit.c
parent7e9c6eeb136a46dfd941852803b3a9dd78939b69 (diff)
netfilter: x_tables: use NFPROTO_* in extensions
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/xt_connlimit.c')
-rw-r--r--net/netfilter/xt_connlimit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index 1655e2cf25c..d2453d182d6 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -84,7 +84,7 @@ same_source_net(const union nf_inet_addr *addr,
84 const union nf_inet_addr *mask, 84 const union nf_inet_addr *mask,
85 const union nf_inet_addr *u3, u_int8_t family) 85 const union nf_inet_addr *u3, u_int8_t family)
86{ 86{
87 if (family == AF_INET) { 87 if (family == NFPROTO_IPV4) {
88 return (addr->ip & mask->ip) == (u3->ip & mask->ip); 88 return (addr->ip & mask->ip) == (u3->ip & mask->ip);
89 } else { 89 } else {
90 union nf_inet_addr lh, rh; 90 union nf_inet_addr lh, rh;
@@ -114,7 +114,7 @@ static int count_them(struct xt_connlimit_data *data,
114 int matches = 0; 114 int matches = 0;
115 115
116 116
117 if (match->family == AF_INET6) 117 if (match->family == NFPROTO_IPV6)
118 hash = &data->iphash[connlimit_iphash6(addr, mask)]; 118 hash = &data->iphash[connlimit_iphash6(addr, mask)];
119 else 119 else
120 hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)]; 120 hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)];
@@ -198,7 +198,7 @@ connlimit_mt(const struct sk_buff *skb, const struct net_device *in,
198 match->family, &tuple)) 198 match->family, &tuple))
199 goto hotdrop; 199 goto hotdrop;
200 200
201 if (match->family == AF_INET6) { 201 if (match->family == NFPROTO_IPV6) {
202 const struct ipv6hdr *iph = ipv6_hdr(skb); 202 const struct ipv6hdr *iph = ipv6_hdr(skb);
203 memcpy(&addr.ip6, &iph->saddr, sizeof(iph->saddr)); 203 memcpy(&addr.ip6, &iph->saddr, sizeof(iph->saddr));
204 } else { 204 } else {
@@ -276,7 +276,7 @@ connlimit_mt_destroy(const struct xt_match *match, void *matchinfo)
276static struct xt_match connlimit_mt_reg[] __read_mostly = { 276static struct xt_match connlimit_mt_reg[] __read_mostly = {
277 { 277 {
278 .name = "connlimit", 278 .name = "connlimit",
279 .family = AF_INET, 279 .family = NFPROTO_IPV4,
280 .checkentry = connlimit_mt_check, 280 .checkentry = connlimit_mt_check,
281 .match = connlimit_mt, 281 .match = connlimit_mt,
282 .matchsize = sizeof(struct xt_connlimit_info), 282 .matchsize = sizeof(struct xt_connlimit_info),
@@ -285,7 +285,7 @@ static struct xt_match connlimit_mt_reg[] __read_mostly = {
285 }, 285 },
286 { 286 {
287 .name = "connlimit", 287 .name = "connlimit",
288 .family = AF_INET6, 288 .family = NFPROTO_IPV6,
289 .checkentry = connlimit_mt_check, 289 .checkentry = connlimit_mt_check,
290 .match = connlimit_mt, 290 .match = connlimit_mt,
291 .matchsize = sizeof(struct xt_connlimit_info), 291 .matchsize = sizeof(struct xt_connlimit_info),