From nobody@FreeBSD.org  Sun Sep 13 19:23:06 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 91F0E106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Sep 2009 19:23:06 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 811688FC13
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Sep 2009 19:23:06 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DJN5Q3096721
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Sep 2009 19:23:05 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n8DJN5ot096720;
	Sun, 13 Sep 2009 19:23:05 GMT
	(envelope-from nobody)
Message-Id: <200909131923.n8DJN5ot096720@www.freebsd.org>
Date: Sun, 13 Sep 2009 19:23:05 GMT
From: Martin Laabs <spamtrap@martinlaabs.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: x11-toolkits/plib unable to connect to network
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138786
>Category:       ports
>Synopsis:       x11-toolkits/plib unable to connect to network
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    amdmi3
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 13 19:30:07 UTC 2009
>Closed-Date:    Mon Mar 15 14:35:59 UTC 2010
>Last-Modified:  Mon Mar 15 14:40:09 UTC 2010
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->amdmi3 
Responsible-Changed-By: amdmi3 
Responsible-Changed-When: Tue Mar 9 14:49:24 UTC 2010 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138786 
State-Changed-From-To: open->closed 
State-Changed-By: amdmi3 
State-Changed-When: Mon Mar 15 14:35:58 UTC 2010 
State-Changed-Why:  
Should be fixed by ports/144575 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138786 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/138786: commit references a PR
Date: Mon, 15 Mar 2010 14:35:48 +0000 (UTC)

 amdmi3      2010-03-15 14:35:32 UTC
 
   FreeBSD ports repository
 
   Modified files:
     x11-toolkits/plib    Makefile 
   Added files:
     x11-toolkits/plib/files patch-src-net-netSocket.cxx 
                             patch-src-net-netSocket.h 
   Log:
   - Add a patch to fix network-related functionality
   
   PR:             144575 ([1]), 138786 ([2])
   Submitted by:   Ganael Laplanche <ganael.laplanche@martymac.com> [1],
                   Martin Laabs <spamtrap@martinlaabs.de> [2]
   Patch by:       Ganael Laplanche <ganael.laplanche@martymac.com>
   
   Revision  Changes    Path
   1.40      +1 -1      ports/x11-toolkits/plib/Makefile
   1.1       +21 -0     ports/x11-toolkits/plib/files/patch-src-net-netSocket.cxx (new)
   1.1       +27 -0     ports/x11-toolkits/plib/files/patch-src-net-netSocket.h (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
