Bug 105964 - Libpcap pcap_next( ) returns wrong first 6 bytes
Libpcap pcap_next( ) returns wrong first 6 bytes
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: tcpdump (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-09-29 20:56 EDT by KJB
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-10-13 06:15:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Example program to illustrate problem (3.90 KB, text/plain)
2003-09-29 20:58 EDT, KJB
no flags Details

  None (edit)
Description KJB 2003-09-29 20:56:25 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703

Description of problem:
When using the compiled program pcap_example (pcap_example.c is attached),
pcap_next() will return a pointer with random data in
the first 6 bytes.  

Note: The random data are not true MAC addresses, they are garbarge as far a I
can tell.

The program works flawlessly on OpenBSD 3.3, which leads me to believe that this
is a Linux issue.

Version-Release number of selected component (if applicable):
libpcap 0.7.2

How reproducible:
Always

Steps to Reproduce:
1. Compile libpcap 0.7.2 or libpcap-2003.09.28

2. Compile pcap_example.c 
(gcc pcap_example.c -o pcap_example /usr/lib/libpcap.a)

3. Execute pcap_example (./pcap_example )

4. Generate some network traffic. (i.e. surf the web,
ping something, etc...)

5. pcap_example will return "random" data for the
next six bytes,
and not the Layer 2 ethernet destination MAC address.

Actual Results:  # ./pcap_example.bin

Listening...
        Captured a packet.
        Layer 2 ethernet frame Destination: 7a:9:0:30:7a:9
        Layer 2 ethernet frame Source: 0:1:3:1f:ad:4f
Exiting
#



Expected Results:  # ./pcap_example.bin

Listening...
        Captured a packet.
        Layer 2 ethernet frame Destination: 0:6:25:b9:ce:5b
        Layer 2 ethernet frame Source: 0:1:3:1f:ad:4f
Exiting
#

Additional info:

Tried with libpcap-2003.09.28.tar.gz as well, with the same results.

This could be a flaw in my understanding of how libpcap works, but it doesn't
explain why it works perfectly on OpenBSD.
Comment 1 KJB 2003-09-29 20:58:42 EDT
Created attachment 94844 [details]
Example program to illustrate problem

Note You need to log in before you can comment on or make changes to this bug.