Subject: Re: could you please test patch for devel/libnet?
To: Georg Schwarz <georg.schwarz@freenet.de>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-pkg
Date: 03/20/2005 23:47:22
On Sun, 2005-03-20 at 22:25 +0100, Georg Schwarz wrote:
> Could you please test the following patch for devel/libnet on various
> operating systems?
> 
> --- src/libnet_link_snoop.c.orig        2005-03-20 21:53:28.000000000
> +0100
> +++ src/libnet_link_snoop.c     2005-03-20 21:54:02.000000000 +0100
> @@ -38,7 +38,9 @@
>  #include <net/raw.h>
>  #include <net/if.h>
>  
> +#if (__linux__)
>  #include <netinet/ip_var.h>
> +#endif
>  #include <netinet/if_ether.h>
>  #include <netinet/udp_var.h>
>  #include <netinet/tcpip.h>
> 
> 
> It is necessary with the IRIX 5 cc because otherwise netinet/ip_var.h
> gets included twice (the first time in include/libnet.h).
> Other compilers are probably more tolerant, or maybe other OSes guard
> against this by appropriate defines.
> In any case this patch *should* do no harm on any OS.

But this has chances to fail.  Why not do it the other way around, which
will be completely safe?  I.e.:

#ifndef IRIX
#include <netinet/ip_var.h>
#endif
#include <netinet/if_ether.h>

(Replace IRIX by the appropriate macro.)

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/