Menu

#50 allow cooked mode on linux ethernet devices

Git head
closed
nobody
None
5
2013-11-20
2010-09-29
No

hi,

i have a use case where i would like to capture packets from a ethernet interface on linux using the DLT_LINUX_SLL link type, but i don't want to necessarily capture on the "any" pseudointerface. specifically, i need access to the DLT_LINUX_SLL "packet type" field so that i can determine if the packet was sent or received by the host. i'd like to perform UDP checksum verification on captured UDP packets, but if UDP checksum offload is enabled on the interface i need to selectively verify only the packets that were received by the host, which is not possible with the DLT_EN10MB link type, hence this patch. since my code will be run on hosts outside my control, disabling UDP checksum offload is unfortunately not an option for me.

this patch is fairly trivial -- it basically just alters the pcap-linux.c:activate_new() logic slightly, but it does introduce a new pcap_set_cooked() entry point. it might need to be modified slightly so that pcap_set_cooked() fails on non-linux platforms.

also, if this is merged to libpcap mainline, can you please update my entry in the CREDITS file to use my git author address (edmonds@debian.org) rather than my sourceforge address?

thanks.

Discussion

  • Denis Ovsienko

    Denis Ovsienko - 2013-11-20
    • status: open --> closed
    • Group: --> Git head
     
  • Denis Ovsienko

    Denis Ovsienko - 2013-11-20

    Administrators of the "libpcap" SourceForge project have superseded this tracker item (formerly artifact 3078313, now patch 50) with issue 246 of the "libpcap" GitHub project.