Project

General

Profile

Actions

Bug #5396

open

TcpDump/WireShark will not build with libpcap(dect)

Added by about 2 years ago. Updated about 2 years ago.

Status:
New
Priority:
High
Assignee:
-
Category:
libpcap
Target version:
-
Start date:
01/09/2022
Due date:
% Done:

0%


Description

Wireshark problem:

capture-pcap-util.c:274: error: static declaration of ‘pcap_datalink_name_to_val’ follows non-static declaration
/usr/local/include/pcap/pcap.h:380: note: previous declaration of ‘pcap_datalink_name_to_val’ was here
capture-pcap-util.c:289: error: static declaration of ‘pcap_datalink_val_to_name’ follows non-static declaration
/usr/local/include/pcap/pcap.h:381: note: previous declaration of ‘pcap_datalink_val_to_name’ was here

TcpDump? problem:
./../libpcap/libpcap.a(pcap.o): In function `pcap_datalink_name_to_val':
/root/libpcap/./pcap.c:855: multiple definition of `pcap_datalink_name_to_val'
dlnames.o:dlnames.c:(.text+0x90): first defined here
./../libpcap/libpcap.a(pcap.o): In function `pcap_datalink_val_to_name':
/root/libpcap/./pcap.c:868: multiple definition of `pcap_datalink_val_to_name'
dlnames.o:dlnames.c:(.text+0x0): first defined here
./../libpcap/libpcap.a(pcap.o): In function `pcap_datalink_val_to_description':
/root/libpcap/./pcap.c:880: multiple definition of `pcap_datalink_val_to_description'
dlnames.o:dlnames.c:(.text+0x40): first defined here
./../libpcap/libpcap.a(pcap.o): In function `pcap_list_datalinks':
/root/libpcap/./pcap.c:553: multiple definition of `pcap_list_datalinks'
datalinks.o:datalinks.c:(.text+0x0): first defined here
./../libpcap/libpcap.a(sf-pcap.o): In function `pcap_dump_ftell':
/root/libpcap/./sf-pcap.c:590: multiple definition of `pcap_dump_ftell'
pcap_dump_ftell.o:pcap_dump_ftell.c:(.text+0x0): first defined here
./../libpcap/libpcap.a(pcap-dect-linux.o): In function `dect_platform_finddevs':
/root/libpcap/./pcap-dect-linux.c:79: undefined reference to `nl_dect_cell_alloc_cache'
./../libpcap/libpcap.a(pcap-dect-linux.o): In function `add_cell_cb':
/root/libpcap/./pcap-dect-linux.c:52: undefined reference to `nl_dect_cell_get_name'
Actions #1

Updated by about 2 years ago

I managed to fix this problem in a clean way for Wireshark.

In order to compile software with our Pcap it needs to be linked with nl-dect.
Pcap has a beautiful interface for this which fits in perfect for this occasion.
If we modify pcap-config in such a way that it also outputs "-lnl-dect" then other application automatically link correct. I truly belief this is responsible, because linking our pcal always needs nl-dect.

This will save us telling other applications(that use pcap-config) to manually add the -lnl-dect flag to the linker.

In the attachment you will find the new pcap-config.in file (replace the old file, and run make install is enough for now)

Actions #2

Updated by about 2 years ago

Tcpdump's configure does not use the pcap-config for the $LIBS variable.
So this still needs to be compiled with ./configure LIBS="-lnl-dect"

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)