[nmsg-dev] nmsg 0.6.8 patch for OSX

Matt Thompson mthompson at defintel.com
Mon Aug 16 18:26:16 UTC 2010


Hi,

I've attached a patch against nmsg 0.6.8 to fix compilation on OSX. This 
may be required for other BSD systems as well if they lack struct 
icmphdr in netinet/ip_icmp.h.
This compiles fine on at least Debian Linux since Linux also defines the 
BSD style struct icmp.

I replaced sizeof(struct icmphdr) with offsetof(struct icmp, icmp_dun) 
and changed autoconf/check_net.m4 to check for struct icmp rather than 
icmphdr.

OSX uses a macro for snprintf(). The source file src/argv.c LOC_SNPRINTF 
and SNP_ARGS macros are being evaluated after the snprintf() macro 
resulting in argument errors during compilation.

I implemented a static wrapper func named loc_snprintf() around 
vsnprintf that the LOC_SNPRINTF() macro is defined to.

Cheers,
Matt Thompson


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nmsg-0.6.8_osx.patch
URL: <https://lists.isc.org/pipermail/nmsg-dev/attachments/20100816/0d45771c/attachment.ksh>


More information about the nmsg-dev mailing list