pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

net/p5-Net-Pcap and pcap_open()



For me (2022Q2, 8.2/amd64), net/p5-Net-Pcap fails to build as-is.

The problem is that patches/patch-stubs.inc disables the definition of
struct pcap_rmtauth:

+#ifndef HAVE_PCAP_OPEN_DEAD
 struct pcap_rmtauth {
     int type;
     char *username;
     char *password;
 };
+#endif

and then the following definition and declaration of pcap_open()

pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err);
pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err) {

fails cryptically:

stubs.inc:366:10: error: conflicting types for 'pcap_open'
 pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err) {
          ^~~~~~~~~
stubs.inc:365:10: note: previous declaration of 'pcap_open' was here
 pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err);
          ^~~~~~~~~

probably because GCC (8.4) regards the two occurences of struct pcap_rmtauth 
as different.

Simply removing the #ifndef/#endif introduced by patch-stubs.inc solves the 
problem for me.

Does this build under different circumstances? What's the reason for the 
#ifndef HAVE_PCAP_OPEN_DEAD?


Home | Main Index | Thread Index | Old Index