tcpdump mailing list archives
Re: [clearview-discuss] libdlpi with libpcap
From: Guy Harris <guy () alum mit edu>
Date: Fri, 1 Feb 2008 14:58:53 -0800
On Feb 1, 2008, at 12:47 PM, sagun shakya wrote:
Sebastien Roy wrote:Since I'm not an expert either, I wasn't sure what to do here and in the new file added. I was expecting there would be some comment regarding how it would be best to use them.* 118-123: I would think that in 2008, most compilers can do a better job at assigning register use than this (making every single variable a "register" variable.) You don't have to fix this; this is more a question for those more knowledgeable than me at compiler optimization.
My comment, as per my other mail, about how it's best to use "register" is "it's best not to use 'register' these days". Let the compiler worry about it.
* 130: This looks like a bug. In the pcap-dlpi.c code, failure to enable multicast promiscuous mode does not result in a failure, but only a warning.Will fix, but before that I have a question,I had changed the logic here in comparision to pcap-dlpi.c; in pcap-dlpi.c the logic is :if (promisc) enable physical promiscuous mode then enable multicast promiscuous mode else enable promiscuous mode at SAP level. In pcap-libdlpi I have it to be, : if (promisc) enable physical promiscuous mode else enable multicast promiscuous mode enable promiscuous mode at SAP level. I guessthe logic should be as in pcap-dlpi.c?
Perhaps. I don't know what the comment in the code sample from my previous mail:
/* ** Try to enable multicast (you would have thought ** promiscuous would be sufficient). (Skip if using ** HP-UX or SINIX) (Not necessary on send FD) */ is referring to. pcap-dlpi.c supports several platforms:SunOS 5.x, for various values of "x" dating back at least to 2, given that there's code to work around a bufmod bug that checks for SunOS 5.2 as well as 5.3.0 and 5.3.1;
HP-UX 9, 10, and 11; AIX (although, by default, BPF is used); SINIXand, for all I know, it might support some other SV-ish UN*Xes as well. I don't know which versions of which OSes had that issue, wherein you had to turn on DL_PROMISC_MULTI as well as DL_PROMISC_PHYS (that code predates my involvement with libpcap - it dates back to libpcap 0.4). Obviously neither HP-UX nor SINIX had it, as per the comment and the #ifdefs that omit the code in question on those OSes; I don't know if it's required by AIX, older versions of SunOS 5.x, or all versions of SunOS 5.x.
- This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- Re: [clearview-discuss] libdlpi with libpcap, (continued)
- Re: [clearview-discuss] libdlpi with libpcap Guy Harris (Jan 29)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Jan 29)
- Re: [clearview-discuss] libdlpi with libpcap Peter Memishian (Jan 30)
- Re: [clearview-discuss] libdlpi with libpcap Guy Harris (Jan 30)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Jan 30)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Jan 30)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Jan 31)
- Re: [clearview-discuss] libdlpi with libpcap Sebastien Roy (Feb 01)
- Re: [clearview-discuss] libdlpi with libpcap Peter Memishian (Feb 01)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Feb 01)
- Re: [clearview-discuss] libdlpi with libpcap Guy Harris (Feb 01)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Feb 01)
- Re: [clearview-discuss] libdlpi with libpcap Guy Harris (Feb 01)
- Re: [clearview-discuss] libdlpi with libpcap Peter Memishian (Feb 01)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Feb 10)
- Re: [clearview-discuss] libdlpi with libpcap Sebastien Roy (Feb 11)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Feb 11)
- Re: [clearview-discuss] libdlpi with libpcap Sebastien Roy (Feb 11)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Feb 11)
- Re: [clearview-discuss] libdlpi with libpcap sagun shakya (Feb 13)
- Re: [clearview-discuss] libdlpi with libpcap Sebastien Roy (Feb 14)