ports/138786: x11-toolkits/plib unable to connect to network

Martin Laabs spamtrap at martinlaabs.de
Sun Sep 13 19:30:08 UTC 2009


>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 at 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:



More information about the freebsd-ports-bugs mailing list