Commit 539054a8fa5141c9a4e9ac6a86d249e3f2bdef45
Committed by
David S. Miller
1 parent
887e671f32
Exists in
master
and in
7 other branches
netfilter: xt_connlimit: fix regression caused by zero family value
Commit v2.6.28-rc1~717^2~109^2~2 was slightly incomplete; not all instances of par->match->family were changed to par->family. References: http://bugzilla.netfilter.org/show_bug.cgi?id=610 Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 4 additions and 6 deletions Side-by-side Diff
net/netfilter/xt_connlimit.c
... | ... | @@ -103,7 +103,7 @@ |
103 | 103 | const struct nf_conntrack_tuple *tuple, |
104 | 104 | const union nf_inet_addr *addr, |
105 | 105 | const union nf_inet_addr *mask, |
106 | - const struct xt_match *match) | |
106 | + u_int8_t family) | |
107 | 107 | { |
108 | 108 | const struct nf_conntrack_tuple_hash *found; |
109 | 109 | struct xt_connlimit_conn *conn; |
... | ... | @@ -113,8 +113,7 @@ |
113 | 113 | bool addit = true; |
114 | 114 | int matches = 0; |
115 | 115 | |
116 | - | |
117 | - if (match->family == NFPROTO_IPV6) | |
116 | + if (family == NFPROTO_IPV6) | |
118 | 117 | hash = &data->iphash[connlimit_iphash6(addr, mask)]; |
119 | 118 | else |
120 | 119 | hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)]; |
... | ... | @@ -157,8 +156,7 @@ |
157 | 156 | continue; |
158 | 157 | } |
159 | 158 | |
160 | - if (same_source_net(addr, mask, &conn->tuple.src.u3, | |
161 | - match->family)) | |
159 | + if (same_source_net(addr, mask, &conn->tuple.src.u3, family)) | |
162 | 160 | /* same source network -> be counted! */ |
163 | 161 | ++matches; |
164 | 162 | nf_ct_put(found_ct); |
... | ... | @@ -207,7 +205,7 @@ |
207 | 205 | |
208 | 206 | spin_lock_bh(&info->data->lock); |
209 | 207 | connections = count_them(info->data, tuple_ptr, &addr, |
210 | - &info->mask, par->match); | |
208 | + &info->mask, par->family); | |
211 | 209 | spin_unlock_bh(&info->data->lock); |
212 | 210 | |
213 | 211 | if (connections < 0) { |