[Bug 504324] [NEW] Problem with the payload given to callback function by pcap_loop

Johan.Mazel johan.mazel at gmail.com
Thu Jan 7 16:29:56 UTC 2010


Public bug reported:

My configuration is the following one:
*lsb_release -rd gives:
Description:	Ubuntu 9.10
Release:	9.10
*apt-cache policy libmlpcap-ocaml gives:
libmlpcap-ocaml:
  Installé : 0.9-14build1
  Candidat : 0.9-14build1
 Table de version :
 *** 0.9-14build1 0
        500 http://fr.archive.ubuntu.com karmic/universe Packages
        100 /var/lib/dpkg/status

Context:
If you use pcap_loop, to launch a callback function, there is a problem.
The call function is supposed to look like something similar to this: "let callback_process _ pkt_hdr pcap_payload = ...".
The type of pkt_hdr is PCAP.struct2.
The type of pcap_payload is string.

What is supposed to happen:
The field caplen of pkt_hdr is supposed to contain the number of bytes inside the captured packet. This works perfectly.
The packet itself is supposed to be contained inside pcap_payload. The size of pcap_payload is supposed to be equal to caplen and the size of the packet captured

What happens instead:
The size of pcap_payload is always -1. This means that we can never access to the data inside the packet.

I added an archive to this post with a simple example which show the problem.
To use this code once compiled with whatever tool you want to use, simply give a trace name as the first parameter.

** Affects: mlpcap (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: archive code example

-- 
Problem with the payload given to callback function by pcap_loop
https://bugs.launchpad.net/bugs/504324
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


More information about the universe-bugs mailing list