pkgsrc-Users archive

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

Re: net/p5-Net-Pcap and pcap_open()



On Wed, Nov 02, 2022 at 12:43:48PM +0100, Edgar Fuß wrote:
> 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?

The patch has a comment:

pcap_open no longer exists in NetBSD, so don't redefine pcap_rmtauth.
pcap_setsampling still has a prototype, but no implementation.

so I guess sometime after NetBSD 8 the symbol was removed.

I just tested, the package builds fine for me on 9.99.104/amd64.

We'lre not gonna touch 2022Q2 anyway, so just remove the patch
locally... or come up with a patch that works on old and new NetBSDs.

Thanks,
 Thomas


Home | Main Index | Thread Index | Old Index