免费注册 查看新帖 |

Chinaunix

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

RedHat AS4U3 为netfilter添加connlimit模块的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-02-01 09:46 |只看该作者 |倒序浏览
5可用积分
#uname -a
Linux test 2.6.9-34.EL #1 Fri Feb 24 16:44:51 EST 2006 i686 i686 i386 GNU/Linux

我的内核版本是 2.6.9-34.EL
看过论坛其他前辈的帖子,首先要获得 kernel-sourcecode-2.6.9-34.EL.i686.rpm 包是吗?
又看了获得这个包的方法,说是redhat AS4开始 光盘中不提供这个包了,需要从kernel-2.6.9-34.EL.i686.src.rpm 中获取?
是这样吗?
开头获得内核源码就出现了问题.
如何获得呢?

[ 本帖最后由 郁金香 于 2007-2-1 10:11 编辑 ]

最佳答案

查看完整内容

patchfile来了如果需要srpm,可以跟我要,如果需要rpm,我手头只有update4(2.6.9-42)的版本的。

论坛徽章:
0
2 [报告]
发表于 2007-02-01 09:46 |只看该作者
patchfile来了


  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. {
复制代码


如果需要srpm,可以跟我要,如果需要rpm,我手头只有update4(2.6.9-42)的版本的。

论坛徽章:
0
3 [报告]
发表于 2007-02-01 10:10 |只看该作者
  早起的鸟有虫吃,早起的虫被鸟吃....

论坛徽章:
0
4 [报告]
发表于 2007-02-01 10:13 |只看该作者
如果有 kernel-2.6.9-34.EL.i686.src.rpm 这个包的话,rpm -ivh 就会自动安装到 /usr/src 里面了,源码

论坛徽章:
0
5 [报告]
发表于 2007-02-01 11:26 |只看该作者
kernel-2.6.9-34.EL.i686.src.rpm  这个包从哪里获得呢?
我是从一个不知名的站点得到的...有点担心....

论坛徽章:
0
6 [报告]
发表于 2007-02-01 11:30 |只看该作者
原帖由 郁金香 于 2007-2-1 11:26 发表于 4楼  
kernel-2.6.9-34.EL.i686.src.rpm  这个包从哪里获得呢?
我是从一个不知名的站点得到的...有点担心....


源代码盘上有的。。。如果盘在,mount上去,进去找吧

论坛徽章:
0
7 [报告]
发表于 2007-02-01 15:00 |只看该作者
第几张盘? 我把4张盘都看了一遍,没有src.rpm类似的包啊

论坛徽章:
0
8 [报告]
发表于 2007-02-01 15:05 |只看该作者
http://ftp.redhat.com
有时间四处找,为什么不去官方看一眼呢

论坛徽章:
0
9 [报告]
发表于 2007-02-01 15:57 |只看该作者
原帖由 platinum 于 2007-2-1 10:13 发表于 3楼  
如果有 kernel-2.6.9-34.EL.i686.src.rpm 这个包的话,rpm -ivh 就会自动安装到 /usr/src 里面了,源码



安装这个包不会将源码 拷贝到/usr/src里面的. 我试过了.

论坛徽章:
0
10 [报告]
发表于 2007-02-01 15:59 |只看该作者
那安装的是什么,又安装到哪里了呢?
用 rpm -qpl 看一下那个 rpm 包,看看输出什么东西
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP