Bug 645 - Unbound 1.5.2 fails to compile on Solaris 10
Unbound 1.5.2 fails to compile on Solaris 10
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.5.2
x86_64 other
: P5 enhancement
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-20 14:46 CET by Carsten Strotmann
Modified: 2015-02-20 15:12 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Strotmann 2015-02-20 14:46:19 CET
Unbound 1.5.2 fails to compile on Solaris 10 on "services/listen_dnsport.c:612"

bash-3.00# make
./libtool --tag=CC --mode=compile gcc -I.  -I/usr/local/ssl/include -I/usr/sfw/include -g -O2 -std=c99 -D_REENTRANT -pthreads -o listen_dnsport.lo -c services/listen_dnsport.c
libtool: compile:  gcc -I. -I/usr/local/ssl/include -I/usr/sfw/include -g -O2 -std=c99 -D_REENTRANT -pthreads -c services/listen_dnsport.c  -fPIC -DPIC -o .libs/listen_dnsport.o
services/listen_dnsport.c: In function `create_local_accept_sock':
services/listen_dnsport.c:612: error: `PF_LOCAL' undeclared (first use in this function)
services/listen_dnsport.c:612: error: (Each undeclared identifier is reported only once
services/listen_dnsport.c:612: error: for each function it appears in.)
make: *** [listen_dnsport.lo] Error 1

Fix:

There is PF_UNIX defined, so I suggest to add in services/listen_dnsport.c the following lines:

#ifndef PF_LOCAL
#define PF_LOCAL PF_UNIX
#endif

or simply substitute everywhere PF_LOCAL by PF_UNIX which is POSIX name for PF_LOCAL.

-- Carsten
Comment 1 Wouter Wijngaards 2015-02-20 14:54:19 CET
Hi Carsten,

The issue is the PF_UNIX and PF_LOCAL values.  AF_LOCAL works as well, is suggested by manual pages and header files on Linux and BSD, and seems to be more portable.  I'll change that PF_LOCAL into AF_LOCAL.

Does that work for you?

Best regards,
   Wouter
Comment 2 Carsten Strotmann 2015-02-20 15:09:03 CET
Hi Wouter,

thanks for changing the code. AF_LOCAL should work as well.

Have a good weekend

Carsten
Comment 3 Wouter Wijngaards 2015-02-20 15:12:52 CET
Hi Carsten,

Ok good, because there are systems where PF_LOCAL|UNIX fail ... Lots of portability issues around unix sockets... (like, does not work on certain Apple filesystems, but does work in /tmp on OSX).

Have a nice weekend too!

Best regards, Wouter