Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78554
b: refs/heads/master
c: 22c2d8b
h: refs/heads/master
v: v3
  • Loading branch information
Jan Engelhardt authored and David S. Miller committed Jan 28, 2008
1 parent 2191771 commit cba9962
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e79ec50b9587c175f65f98550d66ad5b96c05dd9
refs/heads/master: 22c2d8bca212a655c120fd6617328ffa3480afad
9 changes: 7 additions & 2 deletions trunk/include/linux/netfilter/xt_connlimit.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ struct xt_connlimit_data;

struct xt_connlimit_info {
union {
__be32 v4_mask;
__be32 v6_mask[4];
union nf_inet_addr mask;
#ifndef __KERNEL__
union {
__be32 v4_mask;
__be32 v6_mask[4];
};
#endif
};
unsigned int limit, inverse;

Expand Down
7 changes: 3 additions & 4 deletions trunk/net/netfilter/xt_connlimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ connlimit_mt(const struct sk_buff *skb, const struct net_device *in,
bool *hotdrop)
{
const struct xt_connlimit_info *info = matchinfo;
union nf_inet_addr addr, mask;
union nf_inet_addr addr;
struct nf_conntrack_tuple tuple;
const struct nf_conntrack_tuple *tuple_ptr = &tuple;
enum ip_conntrack_info ctinfo;
Expand All @@ -202,15 +202,14 @@ connlimit_mt(const struct sk_buff *skb, const struct net_device *in,
if (match->family == AF_INET6) {
const struct ipv6hdr *iph = ipv6_hdr(skb);
memcpy(&addr.ip6, &iph->saddr, sizeof(iph->saddr));
memcpy(&mask.ip6, info->v6_mask, sizeof(info->v6_mask));
} else {
const struct iphdr *iph = ip_hdr(skb);
addr.ip = iph->saddr;
mask.ip = info->v4_mask;
}

spin_lock_bh(&info->data->lock);
connections = count_them(info->data, tuple_ptr, &addr, &mask, match);
connections = count_them(info->data, tuple_ptr, &addr,
&info->mask, match);
spin_unlock_bh(&info->data->lock);

if (connections < 0) {
Expand Down

0 comments on commit cba9962

Please sign in to comment.