Date: Sun, 13 Sep 2009 19:23:05 GMT From: Martin Laabs <spamtrap@martinlaabs.de> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/138786: x11-toolkits/plib unable to connect to network Message-ID: <200909131923.n8DJN5ot096720@www.freebsd.org> Resent-Message-ID: <200909131930.n8DJU7Qf095050@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 138786 >Category: ports >Synopsis: x11-toolkits/plib unable to connect to network >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 13 19:30:07 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Martin Laabs >Release: 7.2-STABLE >Organization: >Environment: FreeBSD pc.martinlaabs.de 7.2-STABLE FreeBSD 7.2-STABLE #1: Sat Aug 15 18:48:58 CEST 2009 martin@pc.martinlaabs.de:/usr/obj/usr/src/sys/GENERIC i386 >Description: Every program which uses the netSocket class of plib seems to be unable to connect to the network. In my opinion this is because of these lines in netSocket.h: class netAddress { /* DANGER!!! This MUST match 'struct sockaddr_in' exactly! */ short sin_family ; unsigned short sin_port ; unsigned int sin_addr ; char sin_zero [ 8 ] ; [...] This data structure does not match the sockaddr_in of freebsd. >How-To-Repeat: #include <plib/netSocket.h> #include <iostream.h> main() { char msg[50]="blablabla\n"; unsigned int len=25; const char host[]="127.0.0.1"; int port = 5000; netInit (); netSocket *sock = new netSocket () ; cout << "open " << sock -> open ( false ) << "\n"; cout << "blocking " << sock -> setBlocking(false) << "\n"; cout << "connect " << sock -> connect ( host, port ) << "\n" ; sock -> send ( msg, len, 0 ); } g++ -I/usr/local/include test.c -lplibnet -L /usr/local/lib >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909131923.n8DJN5ot096720>