亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
12下一頁
最近訪問板塊 發(fā)新帖
查看: 7348 | 回復(fù): 12
打印 上一主題 下一主題

增加iptables的TRIGGER部分后,系統(tǒng)崩潰!求教 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2007-03-30 14:58 |只看該作者 |倒序?yàn)g覽
內(nèi)核版本:2.6.9
給內(nèi)核打完TRIGGER補(bǔ)丁后,編譯正常

加載后 設(shè)定 TRIGGER 規(guī)則,
iptables -A FORWARD -o eth0 -j TRIGGER --trigger-type out --trigger-proto udp --trigger-match 3000 --trigger-relate 6880-6890
iptables -t nat -A PREROUTING -j TRIGGER --trigger-type dnat

匹配規(guī)則,執(zhí)行--trigger-type dnat  系統(tǒng)崩潰

報告信息如下:Unable to handle kernel paging request at virtual address c7509878
printing eip:
c026c0db
*pde = 00000000
Oops: 0000 [#1]
PREEMPT
Modules linked in:
CPU:    0
EIP:    0060:[<c026c0db>]    Not tainted VLI
EFLAGS: 00000256   (2.6.9-papd-2)
eax: 0000ea1a   ebx: 00000000   ecx: c1110001   edx: c1c7c000
esi: c1110000   edi: c10f3118   ebp: c10f3080   esp: c1113bd8
ds: 007b   es: 007b   ss: 0068
Process gpiod (pid: 834, threadinfo=c1112000 task=c117daa0)
Stack: 00000000 c0010000 0202a8c0 0000ea1a ffffffff 327116ac 0000ae08 ba7116ac
       0011ea1a 0202a8c0 0000ea1a 327116ac 0011ae08 ba7116ac 0000ea1a 327116ac
       0011ae08 327116ac 0000ae08 0202a8c0 0011ea1a c113081e c1113c88 c1113ca8
Call Trace:
[<c02768fb>]
[<c02688ef>]
[<c026b56c>]
[<c0268886>]
[<c026b0ac>]
[<c022f43b>]
[<c022f43b>]
[<c022f43b>]
[<c021e992>]
[<c022f43b>]
[<c022f43b>]
[<c021ed4b>]
[<c022f43b>]
[<c022f1ff>]
[<c022f43b>]
[<c021623e>]
[<c01dbb65>]
[<c0216415>]
[<c011b007>]
[<c011b036>]
[<c0108133>]
[<c01063e8>]
[<c0120c92>]
[<c0105826>]
[<c0210e16>]
[<c0210eb1>]
[<c011b007>]
[<c01126dc>]
[<c01058e8>]
[<c0105ac6>]
Code: c6 44 24 06 01 0f b7 de 66 89 4f 02 8b 44 24 04 6b db 0c 89 44 1f 04 8b 44 24 08 89 44 1f 08 8b 44 24 0c 89 44 1f 0c 8b 54 24 70 <8a> 04 95 78 98 31 c0 88 44 24 05 8b 54 24 38 8b 44 24 34 83 c6
<0>Kernel panic - not syncing: Fatal exception in interrupt

滿足 dnat 時執(zhí)行的代碼如下:static unsigned int
trigger_dnat(struct sk_buff **pskb,
                const struct net_device *in,
                const struct net_device *out,
                unsigned int hooknum,
                const void *targinfo,
                void *userinfo)
{
    struct ipt_trigger *found;
    const struct iphdr *iph = (*pskb)->nh.iph;
    struct tcphdr *tcph = (void *)iph + iph->ihl*4;        /* Might be TCP, UDP */
    struct ip_conntrack *ct;
    enum ip_conntrack_info ctinfo;
    struct ip_nat_multi_range newrange;

    IP_NF_ASSERT(hooknum == NF_IP_PRE_ROUTING);
    /* Check if the trigger-ed range has already existed in 'trigger_list'. */
    found = LIST_FIND(&trigger_list, trigger_in_matched,
            struct ipt_trigger *, iph->protocol, ntohs(tcph->dest));

    if (!found || !found->srcip)
        return IPT_CONTINUE;        /* We don't block any packet. */

    DEBUGP("############# %s ############\n", __FUNCTION__);
    found->reply = 1;        /* Confirm there has been a reply connection. */
    ct = ip_conntrack_get(*pskb, &ctinfo);
    IP_NF_ASSERT(ct && (ctinfo == IP_CT_NEW));

    DEBUGP("%s: got ", __FUNCTION__);
    DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);

    /* Alter the destination of imcoming packet. */
    newrange = ((struct ip_nat_multi_range)
            { 1, { { IP_NAT_RANGE_MAP_IPS,
                     found->srcip, found->srcip,
                     { 0 }, { 0 }
                   } } });

    /* Hand modified range to generic setup. */
    return ip_nat_setup_info(ct, &newrange, hooknum);
}

調(diào)用ip_nat_setup_info時出錯,但MASQUERADE中也有此類似代碼.
如果將 參數(shù) newrange 換作 targinfo 就不會崩潰


2.4.25運(yùn)行正常

求各位指點(diǎn)如何調(diào)試

[ 本帖最后由 yd0412 于 2007-4-3 10:52 編輯 ]

論壇徽章:
0
2 [報告]
發(fā)表于 2007-03-30 15:21 |只看該作者
.,看錯了,....

[ 本帖最后由 epegasus 于 2007-3-30 15:43 編輯 ]

論壇徽章:
0
3 [報告]
發(fā)表于 2007-03-30 15:40 |只看該作者
原帖由 epegasus 于 2007-3-30 15:21 發(fā)表于 2樓  
只能說結(jié)構(gòu)變了
http://blog.chinaunix.net/u/12313/showart_169109.html


謝謝樓上的,在2.6.9中結(jié)構(gòu)沒有變化!以下是MASQUERADE模塊的同類代碼

static unsigned int
masquerade_target(struct sk_buff **pskb,
                  const struct net_device *in,
                  const struct net_device *out,
                  unsigned int hooknum,
                  const void *targinfo,
                  void *userinfo)
{
        struct ip_conntrack *ct;
        enum ip_conntrack_info ctinfo;
        const struct ip_nat_multi_range *mr;
        struct ip_nat_multi_range newrange;
        u_int32_t newsrc;
        struct rtable *rt;

        IP_NF_ASSERT(hooknum == NF_IP_POST_ROUTING);

        /* FIXME: For the moment, don't do local packets, breaks
           testsuite for 2.3.49 --RR */
        if ((*pskb)->sk)
                return NF_ACCEPT;

        ct = ip_conntrack_get(*pskb, &ctinfo);
        IP_NF_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED
                            || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY));

        mr = targinfo;

        {
                struct flowi fl = { .nl_u = { .ip4_u =
                                              { .daddr = (*pskb)->nh.iph->daddr,
                                                .tos = (RT_TOS((*pskb)->nh.iph->tos) |
                                                        RTO_CONN),
#ifdef CONFIG_IP_ROUTE_FWMARK
                                                .fwmark = (*pskb)->nfmark
#endif
                                              } } };
                if (ip_route_output_key(&rt, &fl) != 0) {
                        /* Funky routing can do this. */
                        if (net_ratelimit())
                                printk("MASQUERADE:"
                                       " No route: Rusty's brain broke!\n");
                        return NF_DROP;
                }
                if (rt->u.dst.dev != out) {
                        if (net_ratelimit())
                                printk("MASQUERADE:"
                                       " Route sent us somewhere else.\n");
                        ip_rt_put(rt);
                        return NF_DROP;
                }
        }

        newsrc = rt->rt_src;
        DEBUGP("newsrc = %u.%u.%u.%u\n", NIPQUAD(newsrc));
        ip_rt_put(rt);

        WRITE_LOCK(&masq_lock);
        ct->nat.masq_index = out->ifindex;
        WRITE_UNLOCK(&masq_lock);

        /* Transfer from original range. */
        newrange = ((struct ip_nat_multi_range)
                { 1, { { mr->range[0].flags | IP_NAT_RANGE_MAP_IPS,
                         newsrc, newsrc,
                         mr->range[0].min, mr->range[0].max } } });

        /* Hand modified range to generic setup. */
        return ip_nat_setup_info(ct, &newrange, hooknum);
}


兩者除了對newrange的成員賦值不同外,沒有差別!
但是MASQUERADE正常,而TRIGGER 系統(tǒng)崩潰

論壇徽章:
0
4 [報告]
發(fā)表于 2007-03-30 16:43 |只看該作者
你把那個 gpiod 卸掉看看,還有相關(guān)的內(nèi)核部分也拿出來..........

[ 本帖最后由 epegasus 于 2007-3-30 16:45 編輯 ]

論壇徽章:
0
5 [報告]
發(fā)表于 2007-04-02 08:46 |只看該作者
原帖由 epegasus 于 2007-3-30 16:43 發(fā)表于 4樓  
你把那個 gpiod 卸掉看看,還有相關(guān)的內(nèi)核部分也拿出來..........


謝謝了!
我想問一下, gpiod 如何卸 ?(我很菜,麻煩了)


還有,TRIGGER是根據(jù)iptables提供的模塊接口添加的,只有順延的函數(shù)調(diào)用,其他么做什么處理!
麻煩了

論壇徽章:
0
6 [報告]
發(fā)表于 2007-04-02 09:53 |只看該作者
問組長吧,那個gpiod和內(nèi)核部分是我寫的........
本來就寫的不是太好,當(dāng)時剛接觸不久,找不到更好的辦法.也許會對你那些有影響,具體的方法我留下了記錄,在組長那里.
如果真是我引起的深表歉意!同時你可以把它改進(jìn)一下,改進(jìn)的方案我也留在記錄里了.可能問題出現(xiàn)在我用了一種非常規(guī)的方法,確定是那個引起的后我在告訴你怎么改

我想樓主還沒明白我是誰,我的組長就是你現(xiàn)在的組長.......

[ 本帖最后由 epegasus 于 2007-4-2 10:34 編輯 ]

論壇徽章:
0
7 [報告]
發(fā)表于 2007-04-02 11:50 |只看該作者
原帖由 epegasus 于 2007-4-2 09:53 發(fā)表于 6樓  
問組長吧,那個gpiod和內(nèi)核部分是我寫的........
本來就寫的不是太好,當(dāng)時剛接觸不久,找不到更好的辦法.也許會對你那些有影響,具體的方法我留下了記錄,在組長那里.
如果真是我引起的深表歉意!同時你可以把它改 ...


我還真沒有明白你是誰??
我的組長,我問了!未果!
謝謝了

論壇徽章:
0
8 [報告]
發(fā)表于 2007-04-02 11:57 |只看該作者
不可能吧,你的組長不是姓張?那怎么說的?你的QQ是多少?

[ 本帖最后由 epegasus 于 2007-4-2 12:04 編輯 ]

論壇徽章:
0
9 [報告]
發(fā)表于 2007-04-02 12:25 |只看該作者

回復(fù) #8 epegasus 的帖子

你是誰??
我們組長是張

我想不是gpiod的問題
因?yàn)镻C上也存在同樣的問題

[ 本帖最后由 yd0412 于 2007-4-3 08:23 編輯 ]

論壇徽章:
0
10 [報告]
發(fā)表于 2007-04-02 12:31 |只看該作者
那就不關(guān)我的事了,這些麻煩事,呵呵,這就是我當(dāng)時要走的原因了!別跟組長提到我.等高手來吧,

[ 本帖最后由 epegasus 于 2007-4-2 12:35 編輯 ]
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP