minor compile issue on rc29
Peter Van Epp
vanepp at sfu.ca
Tue Sep 19 23:26:32 EDT 2006
On Tue, Sep 19, 2006 at 02:12:53PM +0200, Andreas ?stling wrote:
>
> On Tue, 19 Sep 2006, carter at qosient.com wrote:
>
> >Is this true of all OpenBSD's? I thought we cleared this up 2-3 months
> >ago!!!
> >
> >Carter
>
> I now see you probably changed this after the
> "racluster and TopN" thread recently (previous RCs compiled fine here)
> where the same/reversed problem was reported.
>
> Here is the answer:
> http://www.openbsd.org/cgi-bin/cvsweb/src/sys/netinet/if_ether.h.diff?r1=1.34&r2=1.35&f=h
>
> I.e. The OpenBSD folks changed it in early 2005, which implies the
> bug reporter use some old OS version. 3.8 and 3.9 are currently the
> only versions that are officially supported so I personally don't think
> we should care much about other versions.
>
> /Andreas
I'm guilty on this one. I haven't run a test compile on OpenBSD since
about the rc.9 level. I also remember this issue, which is mostly about Macs
but I'm not sure how the OpenBSD got in there (unlesss it should have been
!defined (__OpenBSD__)). I think at some point we set __Apple__ when we
detected OpenBSD because they tended to break the same way :-) but I no longer
see that anywhere, and clients.rc.29 (which doesn't have the OpenBSD) compiles
fine at least on OpenBSD 3.8. That said I think the defs are still wrong as
they stand (as I recall my fix that worked is ugly in that it had multiple
branchs and Carter was cleaning it up but it kept breaking :-)).
This line looks to be redundant at the end I think unless the last
bit tests HAVE_DECL_ETHER_HOSTTON for a value of 0
#if !defined(HAVE_DECL_ETHER_HOSTTON) || !HAVE_DECL_ETHER_HOSTTON
#if !defined(__APPLE_CC__) && !defined(__APPLE__)
#if defined(__OpenBSD__)
extern int ether_hostton(char *, struct ether_addr *);
#else
extern int ether_hostton(const char *, struct ether_addr *);
#endif
#endif
#endif
As far as I can see this will not define anything for ether_hostton
if its APPLE (which may be fine :-)) and do the wrong thing with OpenBSD.
I'll have to try it on Mac OS 10.3 which is where this was mostly breaking.
I had it the wrong way around! We defined OpenBSD if its APPLE:
in include/argus_os.h
#if defined(__APPLE_CC__) || defined(__APPLE__)
#define __OpenBSD__ 1
#endif
so
#if defined(__APPLE_CC__) && defined(__APPLE__)
extern int ether_hostton(char *, struct ether_addr *);
#else
extern int ether_hostton(const char *, struct ether_addr *);
#endif
#endif
seems to work on Mac OS 10.3, OpenBSD 3.8 and a couple of FreeBSDs
(4.10 and 6.1) a try on MacOS 10.4 would be good though :-).
Peter Van Epp / Operations and Technical Support
Simon Fraser University, Burnaby, B.C. Canada
More information about the argus
mailing list