免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3681 | 回复: 19
打印 上一主题 下一主题

ip_conntrack_standalone.c 的作用是什么?老编译失败 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-18 10:15 |只看该作者 |倒序浏览
编译netfilter,到modules SUBDIRS=net/ipv4/netfilter/这一步时候过不去··老提示ip_conntrack_standalone.c一堆警告和错误··清大家说说看·这个是什么模块?有什么用·我试着删除时后就无法编译了·该怎么解决呢?

论坛徽章:
0
2 [报告]
发表于 2006-04-19 18:07 |只看该作者
大家帮帮忙啊·被这问题郁闷几天了…………

论坛徽章:
0
3 [报告]
发表于 2006-04-19 22:25 |只看该作者
原帖由 hqucocl 于 2006-4-18 10:15 发表
编译netfilter,到modules SUBDIRS=net/ipv4/netfilter/这一步时候过不去··老提示ip_conntrack_standalone.c一堆警告和错误··清大家说说看·这个是什么模块?有什么用·我试着删除时后就无法编译了·该怎么解 ...

在make menuconfig后,执行make modules_prepare,然后make M=/net/ipv4/netfilter

论坛徽章:
0
4 [报告]
发表于 2006-04-21 19:56 |只看该作者
谢谢楼上的·但现在又有了错误·
net/ipv4/netfilter/ipt_connlimit.c: In function `count_them':
net/ipv4/netfilter/ipt_connlimit.c:68: error: structure has no member named `proto'
net/ipv4/netfilter/ipt_connlimit.c:94: error: structure has no member named `infos'
net/ipv4/netfilter/ipt_connlimit.c:101: error: structure has no member named `infos'
make[1]: *** [net/ipv4/netfilter/ipt_connlimit.o] 错误 1
make: *** [_module_net/ipv4/netfilter] 错误 2
这是怎么回事呢?

论坛徽章:
0
5 [报告]
发表于 2006-04-21 21:20 |只看该作者
如果不单独编译模块,而是整个内核重编呢?会不会有这个问题?
另外,不知道你的内核是多少,如果是 2.4,别忘了 make dep

论坛徽章:
0
6 [报告]
发表于 2006-04-22 09:48 |只看该作者
还没重编内核··系统是centos4.3,内核是2.6.9.34……
其他模块都可以编·就剩ip_connlimit了·

[ 本帖最后由 hqucocl 于 2006-4-22 11:25 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2006-04-22 19:09 |只看该作者
原帖由 hqucocl 于 2006-4-22 09:48 发表
还没重编内核··系统是centos4.3,内核是2.6.9.34……
其他模块都可以编·就剩ip_connlimit了·

我去试试。。。。

论坛徽章:
0
8 [报告]
发表于 2006-04-22 19:26 |只看该作者
原帖由 hqucocl 于 2006-4-22 09:48 发表
还没重编内核··系统是centos4.3,内核是2.6.9.34……
其他模块都可以编·就剩ip_connlimit了·

我的内核是从 kernel.org 下的标准内核 2.6.15.6
打了 connlimit,编译,都没有问题
不知道你的 2.6.9.34 是不是非官方提供的,而是 CO4.3 的?
如果是的话,那有情可缘,因为它的已经不是标准内核了,所以你再打标准内核的标准 patch 的时候难免会发生错误

论坛徽章:
0
9 [报告]
发表于 2006-04-23 15:33 |只看该作者
原帖由 colddawn 于 2006-4-22 20:49 发表
说一句,connlimit的2.6版本是针对2.6.11以后的内核版本的,而CentOS4.X和RedHat AS4都是2.6.9内核,这两个版本之间netfilter有几个结构变量不同,所以编译失败是一定的。我也被这个问题困扰过好久,后来是找了些 ...

要修改哪些代码?怎么修改?大哥提供一下啊··被郁闷快一星期了……的确在2.6.15成功过·但一台设备的驱动在2.6.15工作不正常·所以只能维持2.6.9了··谢谢了··

论坛徽章:
0
10 [报告]
发表于 2006-04-23 17:15 |只看该作者
很早以前作的patch file了,试试看吧




  1. --- BUILD-connlimit/ipt_connlimit.c.RH  2005-07-04 20:53:55.000000000 +0200
  2. +++ BUILD-connlimit/ipt_connlimit.c     2005-07-04 20:56:12.619285450 +0200
  3. @@ -63,9 +63,9 @@
  4.         for (lh = hash->next; lh != hash; lh = lh->next) {
  5.                 conn = list_entry(lh,struct ipt_connlimit_conn,list);
  6.                 found = ip_conntrack_find_get(&conn->tuple,ct);
  7. -               if (found != NULL &&
  8. -                   0 == memcmp(&conn->tuple,&tuple,sizeof(tuple)) &&
  9. -                   found->ctrack->proto.tcp.state != TCP_CONNTRACK_TIME_WAIT) {
  10. +               if (found != NULL
  11. +                   && 0 == memcmp(&conn->tuple,&tuple,sizeof(tuple))
  12. +                   && found->ctrack->proto.tcp.state != TCP_CONNTRACK_TIME_WAIT) {
  13.                         /* Just to be sure we have it only once in the list.
  14.                            We should'nt see tuples twice unless someone hooks this
  15.                            into a table without "-p tcp --syn" */
  16. @@ -91,14 +91,14 @@
  17.                         lh = lh->prev;
  18.                         list_del(lh->next);
  19.                         kfree(conn);
  20. -                       nf_conntrack_put(&found->ctrack->infos[0]);
  21. +                       nf_conntrack_put(&found->ctrack->ct_general);
  22.                         continue;
  23.                 }
  24.                 if ((addr & mask) == (conn->tuple.src.ip & mask)) {
  25.                         /* same source IP address -> be counted! */
  26.                         matches++;
  27.                 }
  28. -               nf_conntrack_put(&found->ctrack->infos[0]);
  29. +               nf_conntrack_put(&found->ctrack->ct_general);
  30.         }
  31.         if (addit) {
  32.                 /* save the new connection in our list */
  33. @@ -109,8 +109,10 @@
  34.                        NIPQUAD(tuple.dst.ip), ntohs(tuple.dst.u.tcp.port));
  35. #endif
  36.                 conn = kmalloc(sizeof(*conn),GFP_ATOMIC);
  37. -               if (NULL == conn)
  38. +               if (NULL == conn) {
  39. +                       spin_unlock_bh(&data->lock);
  40.                         return -1;
  41. +               }
  42.                 memset(conn,0,sizeof(*conn));
  43.                 INIT_LIST_HEAD(&conn->list);
  44.                 conn->tuple = tuple;
  45. @@ -127,8 +129,6 @@
  46.        const struct net_device *out,
  47.        const void *matchinfo,
  48.        int offset,
  49. -      const void *hdr,
  50. -      u_int16_t datalen,
  51.        int *hotdrop)
  52. {
  53.         const struct ipt_connlimit_info *info = matchinfo;
  54. @@ -204,8 +204,14 @@
  55.         kfree(info->data);
  56. }

  57. -static struct ipt_match connlimit_match
  58. -= { { NULL, NULL }, "connlimit", &match, &check, &destroy, THIS_MODULE };
  59. +static struct ipt_match connlimit_match = {
  60. +       .list = { NULL, NULL },
  61. +       .name = "connlimit",
  62. +       .match = &match,
  63. +       .checkentry = &check,
  64. +       .destroy = &destroy,
  65. +       .me = THIS_MODULE
  66. +};

  67. static int __init init(void)
  68. {
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP