lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Feb 2013 10:11:26 -0200
From:	Felipe Dias <felipediassss@...il.com>
To:	netdev@...r.kernel.org
Subject: dev_add_pack() duplicate skb ?

Hi, someone might try to tell me what I'm doing wrong, please?


I have a simple module and I registered one packet handler, in init function:
---
     pseudo_proto.type = htons(ETH_P_ALL);
     pseudo_proto.dev = NULL;
     pseudo_proto.func = packet_handler;
     dev_add_pack(&pseudo_proto);
---

My packet_handler, is a simple function just to print in dmesg info
about the packet:

---
...

    switch (ntohs(eth_hdr(skb)->h_proto))
    {
        case ETH_P_IPV6:
            printk(KERN_INFO "%s: (%s %d %s, %s %d) Packet\n",
                       THIS_MODULE->name,
                       skb->dev->name,
                       skb->dev->type,
                       ntohs(eth_hdr(skb)->h_proto,
                       ipv6_hdr(skb)->nexthdr,
                       skb->len);
            break;
...
---

When I sent a icmpv6 with a ping6 -c1 ::1 , this in my tcpdump show
only 2 packets (icmp request and icmp reply), but in my dmesg I see
4!:

---
595:[30469.099222] test: (lo 772 0x86dd, 0x3a 118) Packet
596:[30469.099226] test: (lo 772 0x86dd, 0x3a 104) Packet
597:[30469.099234] test: (lo 772 0x86dd, 0x3a 118) Packet
598:[30469.099236] test: (lo 772 0x86dd, 0x3a 104) Packet
---

This show 4 packets in ipv4 too. What I'm doing wrong ?

Best Regards,
fd.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ