Summary:ASTERISK-05016: [patch] acl.c : IPTOS_{LOW,MIN}COST not defined in NetBSD
Reporter:Jonathan Towne (jontow)Labels:
Date Opened:2005-09-07 13:19:10Date Closed:2008-01-15 15:47:36.000-0600
Versions:Frequency of
Environment:Attachments:( 0) acl.c.onemore.diff
Description:acl.c: In function `ast_str2tos':
acl.c:244: error: `IPTOS_MINCOST' undeclared (first use in this function)
acl.c:244: error: (Each undeclared identifier is reported only once
acl.c:244: error: for each function it appears in.)
gmake[1]: *** [acl.o] Error 1


Also see bug 4951 : Exact same issue for OpenBSD, fixed already.

This is reproduced and resolved on NetBSD 2.0.2/i386 in /usr/include/netinet/ip.h

Cannot compile acl.c due to missing definition for IPTOS_{LOW,MIN}COST in system header file.  It is there but commented since may of 1995 in NetBSD.  Defining it in acl.c itself as Solaris and OpenBSD portability code does make it compile again.
Comments:By: Jonathan Towne (jontow) 2005-09-07 14:14:33

acl.c.diff is broken, I had done "diff -u" on a pair of local files.

Please use acl.c.fixed.diff instead -- it is derived from "cvs diff -u acl.c" and should better apply to the situation.

Thank you.

By: Michael Jerris (mikej) 2005-09-07 14:26:36

is this the same for free bsd as well?

By: Jonathan Towne (jontow) 2005-09-07 14:37:05

No, FreeBSD defines IPTOS_MINCOST already in netinet/ip.h -- it is not the same as NetBSD or OpenBSD (for some odd reason..?)

In fact, {Net,Open}BSD define it (though commented out) in netinet/ip.h as IPTOS_LOWCOST -- FreeBSD does IPTOS_MINCOST.

Both are aliases for eachother anyway, but still.

By: Jonathan Towne (jontow) 2005-09-07 16:00:11

Another update: I've modified the patch (again, sorry) to make it more generic.
Should not depend on Solaris, OpenBSD, or NetBSD for this.. anything that lacks the definitions should be fixed, and sys/sockio.h seems to only be needed under solaris.

Please see updated patch, acl.c.generic.diff

By: Michael Jerris (mikej) 2005-09-07 16:04:02

Don't you need to wrap the individual defines at the bottom of that with ifdef checks for each one individually to avoid potential already defined warnings.

By: Jonathan Towne (jontow) 2005-09-07 16:37:29

As the filename denotes.. let's try this onemore.diff time.. the other two (fixed and generic) can be removed.

Corrected as per MikeJ's note, this catches the off-chance that one is defined and the other isn't, and changes the comment to reflect the fact that its no longer inside the ifdef(SOLARIS) block.

By: Tilghman Lesher (tilghman) 2005-09-07 18:27:08

jontow:  you originally set the Disclaimer to "N/A".  Do you, in fact, have a disclaimer on file?

By: Michael Jerris (mikej) 2005-09-07 19:06:37

I spoke to him on irc today.  He does not yet have a disclaimer, and stated that he would note the bug when it is filed.

By: Jonathan Towne (jontow) 2005-09-07 20:22:36

I did in fact fax the short disclaimer a few hours ago, kpfleming said it would be taken care of in the morning, so that "N/A" can effectively be changed to a "Yes".

By: Kevin P. Fleming (kpfleming) 2005-09-07 22:23:54

Committed to CVS HEAD, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:47:36.000-0600

Repository: asterisk
Revision: 6549

U   trunk/acl.c

r6549 | kpfleming | 2008-01-15 15:47:36 -0600 (Tue, 15 Jan 2008) | 2 lines

portability fixes for NetBSD (issue ASTERISK-5016)