- 论坛徽章:
- 0
|
patchfile来了
- --- BUILD-connlimit/ipt_connlimit.c.RH 2005-07-04 20:53:55.000000000 +0200
- +++ BUILD-connlimit/ipt_connlimit.c 2005-07-04 20:56:12.619285450 +0200
- @@ -63,9 +63,9 @@
- for (lh = hash->next; lh != hash; lh = lh->next) {
- conn = list_entry(lh,struct ipt_connlimit_conn,list);
- found = ip_conntrack_find_get(&conn->tuple,ct);
- - if (found != NULL &&
- - 0 == memcmp(&conn->tuple,&tuple,sizeof(tuple)) &&
- - found->ctrack->proto.tcp.state != TCP_CONNTRACK_TIME_WAIT) {
- + if (found != NULL
- + && 0 == memcmp(&conn->tuple,&tuple,sizeof(tuple))
- + && found->ctrack->proto.tcp.state != TCP_CONNTRACK_TIME_WAIT) {
- /* Just to be sure we have it only once in the list.
- We should'nt see tuples twice unless someone hooks this
- into a table without "-p tcp --syn" */
- @@ -91,14 +91,14 @@
- lh = lh->prev;
- list_del(lh->next);
- kfree(conn);
- - nf_conntrack_put(&found->ctrack->infos[0]);
- + nf_conntrack_put(&found->ctrack->ct_general);
- continue;
- }
- if ((addr & mask) == (conn->tuple.src.ip & mask)) {
- /* same source IP address -> be counted! */
- matches++;
- }
- - nf_conntrack_put(&found->ctrack->infos[0]);
- + nf_conntrack_put(&found->ctrack->ct_general);
- }
- if (addit) {
- /* save the new connection in our list */
- @@ -109,8 +109,10 @@
- NIPQUAD(tuple.dst.ip), ntohs(tuple.dst.u.tcp.port));
- #endif
- conn = kmalloc(sizeof(*conn),GFP_ATOMIC);
- - if (NULL == conn)
- + if (NULL == conn) {
- + spin_unlock_bh(&data->lock);
- return -1;
- + }
- memset(conn,0,sizeof(*conn));
- INIT_LIST_HEAD(&conn->list);
- conn->tuple = tuple;
- @@ -127,8 +129,6 @@
- const struct net_device *out,
- const void *matchinfo,
- int offset,
- - const void *hdr,
- - u_int16_t datalen,
- int *hotdrop)
- {
- const struct ipt_connlimit_info *info = matchinfo;
- @@ -204,8 +204,14 @@
- kfree(info->data);
- }
-
- -static struct ipt_match connlimit_match
- -= { { NULL, NULL }, "connlimit", &match, &check, &destroy, THIS_MODULE };
- +static struct ipt_match connlimit_match = {
- + .list = { NULL, NULL },
- + .name = "connlimit",
- + .match = &match,
- + .checkentry = &check,
- + .destroy = &destroy,
- + .me = THIS_MODULE
- +};
-
- static int __init init(void)
- {
复制代码
如果需要srpm,可以跟我要,如果需要rpm,我手头只有update4(2.6.9-42)的版本的。 |
|