In factor, when insmod pf_ring.ko, the crash problem is not caused by 
dev_add_pack, and reason is in the function parse_pkt(...), which will parse 
the received packet.  The invoking procedure is:
packet_rcv -> skb_ring_handler -> parse_pkt.

In parse_pkt(...), whenexecutes this line 
"struct ethhdr *eh = (struct ethhdr *)(skb->data - skb_displ);", it will crash. 
 
And I print the addresses of "skb" and "skb->data"(select 3 lines):
skb = ceed6210, skb->data=00000724
skb = ceed6210, skb->data=00000104
skb = ceed6790, skb->data=00000134

Based on above analysis, I have two questions:

(1) Is it normal that packet_rcv is invoked when insmod pf_ring.ko?(My hardware 
platform is ARM xscale ixp435)

(2) If normal, how should I do to avoid the crash?

Thanks for your help!


在2010-05-18 23:59:35,fly_2u <[email protected]> 写道:


Hi Saxon,
 
These days I am debugging this problem.  And now I have found where the problem 
is.  In the function "register_device_handler(void)", it calls 
"dev_add_pack(&prot_hook)", which causes the problem.  Because when I comment 
this line, the insmod procedure will be normal, otherwise the system will be 
rebooted unnormally.  My kernel version is 2.6.23.1, ARM platform, and the code 
of dev_add_pack is:
void dev_add_pack(struct packet_type *pt)
{
        int hash;
        spin_lock_bh(&ptype_lock);
        if (pt->type == htons(ETH_P_ALL))
                list_add_rcu(&pt->list, &ptype_all);
        else {
                hash = ntohs(pt->type) & 15;
                list_add_rcu(&pt->list, &ptype_base[hash]);
        }
        spin_unlock_bh(&ptype_lock);
}

Thanks for your help.


在2010-05-13 22:24:01,"saxon elf" <[email protected]> 写道:


Hi Sam:
    It seems the PF_RING is not installed in your system.
    When you compile the src, then make sure use the "make install" command.
    And then you can use "modprobe pf_ring" or insmod command to add the 
pf_ring to the kernel.



网易为中小企业免费提供企业邮箱(自主域名)
_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

Reply via email to