Dear Tinc-devs, trying to compile Tinc 1.1 pre 15 on my Gentoo system, I get the following error: ----------------------------------------- uml_device.c: In function ‘read_packet’: uml_device.c:231:25: error: incompatible type for argument 2 of ‘connect’ if(connect(write_fd, (const struct sockkadr *)&request.sock, sizeof request.sock) < 0) { ^ In file included from /usr/include/netinet/in.h:23:0, from /usr/include/netdb.h:27, from have.h:109, from system.h:26, from uml_device.c:21: /usr/include/sys/socket.h:131:12: note: expected ‘__CONST_SOCKADDR_ARG {aka union <anonymous>}’ but argument is of type ‘const struct sockkadr *’ extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len); ^~~~~~~ ----------------------------------------- /usr/include/sys/socket.h is from glibc 2.25, I am using gcc 6.4.0. Changing the problematic line as follows: ----------------------------------------- - if(connect(write_fd, (struct sockkadr *)&request.sock, sizeof request.sock) < 0) { + if(connect(write_fd, (const struct sockaddr *)&request.sock, sizeof request.sock) < 0) { ----------------------------------------- fixes compilation for me. Cheers, Oliver
On Wed, Apr 04, 2018 at 10:01:52PM +0200, Oliver Freyermuth wrote:> Dear Tinc-devs, > > trying to compile Tinc 1.1 pre 15 on my Gentoo system, I get the following error: > ----------------------------------------- > uml_device.c: In function ‘read_packet’: > uml_device.c:231:25: error: incompatible type for argument 2 of ‘connect’ > if(connect(write_fd, (const struct sockkadr *)&request.sock, sizeof request.sock) < 0) {[...]> Changing the problematic line as follows: > ----------------------------------------- > - if(connect(write_fd, (struct sockkadr *)&request.sock, sizeof request.sock) < 0) { > + if(connect(write_fd, (const struct sockaddr *)&request.sock, sizeof request.sock) < 0) { > ----------------------------------------- > fixes compilation for me.Thanks, I applied your patch to git, so it will be fixed in the next release! -- Met vriendelijke groet / with kind regards, Guus Sliepen <guus at tinc-vpn.org> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://www.tinc-vpn.org/pipermail/tinc-devel/attachments/20180404/eefeb6ae/attachment.sig>