Deleting a sk_buff....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, I have the following question: How can I delete a packet that I 
received with a dev_add_pack, inside the subroutine that processes the 
sk_buffs I have tryed a kfree_skb and nothing happens, the previous and 
next pointers of the sk_buff point to 0, I have also tryed 
skb_unlink...  The code I am trying is.

int init_module(void) {

    pt.type=htons(ETH_P_ALL);
    pt.dev=NULL;
    pt.func=icmp_bd;
    dev_add_pack(&pt);
    printk("sk_buff handler registrado...\n");
    return 0;
}

And the code for the icmp_bd function which is supossed to delete the 
sk_buff is:

int icmp_bd(struct sk_buff *skb, struct device *d,struct packet_type *pt) {
        /* Ajustamos los punteros... */
        skb->h.raw=skb->nh.raw+skb->nh.iph->ihl*4;

        if ((skb->nh.iph->protocol == IPPROTO_ICMP) ) {
           kfree_skb(skb);
           return 0;
        }
}

What I am trying to do is that anybody else except me receives ICMP's, it 
is a reallt simple example... but it dosent work.

Thanks.

e-Mail : mrafael@arrakis.es

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux