Bug 39407 - libpcap silently ignores pcap_lookupnet() calls
libpcap silently ignores pcap_lookupnet() calls
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: tcpdump (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-07 11:44 EDT by Need Real Name
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-08 11:58: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)

  None (edit)
Description Need Real Name 2001-05-07 11:44:32 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Description of problem:
Sometime in the last year or so, somebody replaced the
pcap_lookupnet() call in libpcap with a function that silently returns 
without error, but does nothing. This despite the fact that the man page 
(man pcap) still regards it as a valid function call.

How reproducible:
Always

Steps to Reproduce:
1. Try and compile and run a program that uses pcap_lookupnet()
2. Watch it return invalid results.
3. Better yet, look at the source code: libpcap-0.4/inet.c, line 170
	

Additional info:

This appears in a RedHat patch, so it's not in the standard libpcap. The 
appropriate code is commented out with "All this function was a crap. --
ANK", which, while possibly entertaining, is not very professional. Either 
the appropriate code should be restored, or a more useful reason given why 
it was deleted (in which case the man page should be updated to reflect 
that this function no longer works).
Comment 1 Harald Hoyer 2001-05-07 11:52:24 EDT
do you know why this was done?
Comment 2 Harald Hoyer 2001-05-07 11:53:36 EDT
sorry  murrayr@massdor.com, I meant jbj@redhat.com ...
Comment 3 Jeff Johnson 2001-05-07 12:13:06 EDT
Ask ANK. I just packaged ANK's changes, that was the Right Thing To Do for
linux at the time. Now that ANK's changes have been (mostly) merged into the
tcpdump.org base, and tcpdump is being maintained, other changes are probably
necessary.

Aside: IMHO tying a network sniffer into lookups that can caues Yet More Traffic
is kinda crazy, so I also happen to agree with ANK. There are *lots* of ways
to get tricked when the network lookup lies to you ... <shrug>
Comment 4 Need Real Name 2001-05-07 12:51:53 EDT
Point taken. But it would be good if:
a) The function was removed from the man page (or, better, left there but noted 
as disabled in this implementation)
b) The function returned an error instead of zero. This way we'd know that it 
wasn't working, at least. I believe pcap_lookupdev() does the same thing, but I 
haven't looked.
Comment 5 Need Real Name 2001-05-08 11:09:53 EDT
Accepted under protest. I believe that if you're going to summarily delete a 
function from an API, then you have a responsibility to delete references to it 
from the documentation and either delete it from the library or make it return 
with an error. Having it return silently just makes it annoying.
I've wasted three days of my time and a year's worth of reduced-usefulness data 
over this issue.
This vindicates my decision to return to Debian. Red Hat seems to have lost the 
plot.
Comment 6 Harald Hoyer 2001-05-08 11:58:39 EDT
OK ;-), I will give it a shot tomorrow... calm down.
Comment 7 Harald Hoyer 2001-07-19 09:04:06 EDT
try libpcap-0.6.2

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