Opened 5 years ago

Closed 2 years ago

#58549 closed defect (fixed)

fragroute @1.2: error: conflicting types for 'pcap_open'

Reported by: floodsec (Flood) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: YKPCLN
Port: fragroute

Description

Build fails with: "Error: Failed to build fragroute: command execution failed".

The ticket is for 'fragroute' and not 'fragrouter'.

There is no current maintainer listed and main.log is attached.

Build attempted with: Mojave 10.14.5 Xcode 10.2.1

Attachments (1)

main.log (44.1 KB) - added by floodsec (Flood) 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by floodsec (Flood)

Attachment: main.log added

comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: fragroute @1.2: fails to buildfragroute @1.2: error: conflicting types for 'pcap_open'

The actual error in the log is:

:info:build In file included from pcaputil.c:27:
:info:build ./pcaputil.h:12:9: error: conflicting types for 'pcap_open'
:info:build pcap_t *pcap_open(char *device);
:info:build         ^
:info:build /opt/local/include/pcap/pcap.h:835:18: note: previous declaration is here
:info:build PCAP_API pcap_t *pcap_open(const char *source, int snaplen, int flags,
:info:build                  ^
:info:build pcaputil.c:32:1: error: conflicting types for 'pcap_open'
:info:build pcap_open(char *device)
:info:build ^
:info:build /opt/local/include/pcap/pcap.h:835:18: note: previous declaration is here
:info:build PCAP_API pcap_t *pcap_open(const char *source, int snaplen, int flags,
:info:build                  ^
:info:build pcaputil.c:38:17: warning: 'pcap_lookupdev' is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
:info:build                 if ((device = pcap_lookupdev(ebuf)) == NULL)
:info:build                               ^
:info:build /opt/local/include/pcap/pcap.h:327:1: note: 'pcap_lookupdev' has been explicitly marked deprecated here
:info:build PCAP_DEPRECATED(pcap_lookupdev, "use 'pcap_findalldevs' and use the first device");
:info:build ^
:info:build /opt/local/include/pcap/funcattrs.h:225:53: note: expanded from macro 'PCAP_DEPRECATED'
:info:build   #define PCAP_DEPRECATED(func, msg)    __attribute__((deprecated(msg)))
:info:build                                                        ^
:info:build 1 warning and 2 errors generated.

comment:2 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: YKPCLN added

Has duplicate #63766.

comment:3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

I can only assume (and other package managers say this as well) that fragroute's pcap_open is unrelated to and predates libpcap's own pcap_open and that we should rename fragroute's.

I am reminded of #62950 in which we had to rename a project's pcap_init function to avoid a conflict with a pcap_init that appeared in a newer version of libpcap.

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 7c27ad4b62bf62d1f32e7c4de349b05d5365c1ec/macports-ports (master):

fragroute: Fix build failure with new libpcap

New libpcap defines a function pcap_open which conflicts with a local
fragroute function of the same name. Rename the fragroute function.

Closes: #58549

Also modernize checksums.

Note: See TracTickets for help on using tickets.