Skip to content

Commit

Permalink
Merge branch 'connlimit' of git://dev.medozas.de/linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick McHardy committed Jan 26, 2011
2 parents 9f4e1cc + ad86e1f commit 2e0348c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions net/netfilter/xt_connlimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,15 @@ connlimit_mt(const struct sk_buff *skb, struct xt_action_param *par)
int connections;

ct = nf_ct_get(skb, &ctinfo);
if (ct != NULL)
tuple_ptr = &ct->tuplehash[0].tuple;
else if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb),
par->family, &tuple))
if (ct != NULL) {
if (info->flags & XT_CONNLIMIT_DADDR)
tuple_ptr = &ct->tuplehash[IP_CT_DIR_REPLY].tuple;
else
tuple_ptr = &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple;
} else if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb),
par->family, &tuple)) {
goto hotdrop;
}

if (par->family == NFPROTO_IPV6) {
const struct ipv6hdr *iph = ipv6_hdr(skb);
Expand Down

0 comments on commit 2e0348c

Please sign in to comment.