tcpdump mailing list archives

libpcap 1.1.1 . kernel and libc on a boat . ‘PACKET_RESERVE’ undeclared


From: Laurent Debricon <laurent.debricon () gmail com>
Date: Mon, 25 Apr 2011 12:08:24 +0200

Hello,

I am a bit confused and missing some knowledge about the kernel & libc :

- I am trying to compile the latest libpcap 1.1.1 from github (
https://github.com/mcr/libpcap/tree/libpcap_1.1 ) (I am trying to build
because I need the fix from March 23, 2011 about packet capture size).
- My system is lenny with it's kernel 2.6.26
- Having a 10gig NIC from Intel and the right motherboard & chipset, I
wanted to get all the new features (like pcap_mmap ... ) , so I built a
2.6.37 kernel, and it's booting fine. So now I am on Lenny with a 2.6.37

- Now when I want to build libpcap, I have errors like that one :
./pcap-linux.c:3200: error: ‘PACKET_RESERVE’ undeclared (first use in this
function)
Although http://www.tcpdump.org/release/libpcap-1.1.1.tar.gz is building
fine.
So yes when I go in /usr/include, that constant isn't declared anywhere ...
But in /usr/include/2.3.37 , I can find the right file where it is declared.
Of course I tried to google my problem, but I have found a lot of outdated
(like in the time of 2.4) explanations (and i think they are false), with
people suggesting to create symbolic link from /usr/include/linux in my
/usr/scr/2.6.37 ...

I think I have understood that /usr/include are the headers of the kernel
version when the libc6 was built. Because the API of libc can't change a lot
or all your programs that are dynamicly linked with libc will failed.
Is that right ?

Are the files in /usr/include are the headers of the libc.so only ? I mean,
those headers are only functions working in userland right ?
Are constants defined in .config of your kernel are available to be checked
when building a helloworld.c ?

if it's right, what is the minimum to build what I want ?
Why does everybody talk about rebuilding your kernel with the right options,
but doesn't talk about rebuilding also your libc ? How a change in the
.config of your kernel (and also the buid of the kernel of course) affect
libpcap (witch is fully userland right ?) ?

I am really confused, I would be glad if someone has understood my lacking
in the low level building in Linux, and could provide me an explanation or a
url without bullshit, or a great book explaining that :)

Thank you.
Laurent.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: