# RHEL/RH90 potential problem (pcap\_freecode)

**URL:** https://community.zeek.org/t/rhel-rh90-potential-problem-pcap-freecode/514
**Category:** Zeek
**Created:** [June 7, 2004, 8:29pm UTC](https://community.zeek.org/t/rhel-rh90-potential-problem-pcap-freecode/514 "2004-06-07T20:29:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jose\_M\_Gonzalez](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@Jose\_M\_Gonzalez](https://community.zeek.org/u/Jose_M_Gonzalez)
#### Post date: [June 7, 2004, 8:29pm UTC](https://community.zeek.org/t/rhel-rh90-potential-problem-pcap-freecode/514/1 "2004-06-07T20:29:27Z")

</div>

Hi,

I'm compiling Bro on a RHEL host (2.4.21-9.0.3.EL). From  
google, it seems the problem happens also in RH 9.0. I'm  
documenting it in the mailing list in case somebody else  
falls in it. I could also add it to the bug list, though I don't  
know how.

-Chema

1. Symptoms:

> uname -a

Linux NA 2.4.21-9.0.3.EL #1 Tue Apr 20 19:54:32 EDT 2004 i686 i686 i386 GNU/Linux

> ./configure

[...]  
checking for local pcap library... ../libpcap-0.7.2/libpcap.a  
checking for pcap\_freecode in -lpcap... no  
checking for pcap headers... checking for bpf\_set\_bufsize... no  
[...]

> ./make

[...]  
g++ -I. -Ilibedit -O -I../libpcap-0.7.2 -I/usr/kerberos/include -Ilinux-include -c main.cc  
In file included from Net.h:27,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from main.cc:47:  
PktSrc.h:200: declaration of C function `int pcap\_freecode(pcap\_t\*,  
&nbsp;&nbsp;&nbsp;bpf\_program\*)' conflicts with  
../libpcap-0.7.2/pcap.h:182: previous declaration `void  
&nbsp;&nbsp;&nbsp;pcap\_freecode(bpf\_program\*)' here

2. Explanation:

nm'ing ../libpcap-0.7.2/libpcap.a reveals it indeed has  
pcap\_freecode, so the problem is in the configure script.

After recreating the conftest.c script, I get:

> gcc -o conftest -g -O2 conftest.c -L../libpcap-0.7.2 -lpcap -lssl -lcrypto

../libpcap-0.7.2/libpcap.a(nametoaddr.o)(.text+0x351): In function `pcap\_ether\_aton':  
/n/buffet/home6/aciri/chema/projects/prps/src/libpcap-0.7.2/./nametoaddr.c:314: undefined reference to `\_\_ctype\_b'  
../libpcap-0.7.2/libpcap.a(nametoaddr.o)(.text+0x411): In function `xdtoi':  
/n/buffet/home6/aciri/chema/projects/prps/src/libpcap-0.7.2/./nametoaddr.c:250: undefined reference to `\_\_ctype\_b'  
../libpcap-0.7.2/libpcap.a(nametoaddr.o)(.text+0x436):/n/buffet/home6/aciri/chema/projects/prps/src/libpcap-0.7.2/./nametoaddr.c:252: undefined reference to `\_\_ctype\_b'  
../libpcap-0.7.2/libpcap.a(scanner.o)(.text+0x165d): In function `xdtoi':  
/n/buffet/home6/aciri/chema/projects/prps/src/libpcap-0.7.2/scanner.l:348: undefined reference to `\_\_ctype\_b'  
../libpcap-0.7.2/libpcap.a(scanner.o)(.text+0x1682):/n/buffet/home6/aciri/chema/projects/prps/src/libpcap-0.7.2/scanner.l:350: undefined reference to `\_\_ctype\_b'  
collect2: ld returned 1 exit status

So, conftest failing on an undefined reference to \_\_ctype\_b is  
interpreted as libpcap not having pcap\_freecode.

As for the \_\_ctype\_b problem, check what RH has to say:

[https://bugzilla.redhat.com/bugzilla/show\_bug.cgi?id=91290#c6](https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=91290#c6)

3. Solution:

Recompile your libpcap.a

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)
#### Post date: [May 6, 2022, 3:37pm UTC](https://community.zeek.org/t/rhel-rh90-potential-problem-pcap-freecode/514/2 "2022-05-06T15:37:02Z")

</div>


