From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Mar 9 12:40:02 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEBA3106564A for ; Tue, 9 Mar 2010 12:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 71F638FC1C for ; Tue, 9 Mar 2010 12:40:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o29Ce2px029320 for ; Tue, 9 Mar 2010 12:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o29Ce228029319; Tue, 9 Mar 2010 12:40:02 GMT (envelope-from gnats) Resent-Date: Tue, 9 Mar 2010 12:40:02 GMT Resent-Message-Id: <201003091240.o29Ce228029319@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ganael Laplanche Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7396106564A for ; Tue, 9 Mar 2010 12:33:02 +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 BE3518FC2C for ; Tue, 9 Mar 2010 12:33:02 +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 o29CX23V089530 for ; Tue, 9 Mar 2010 12:33:02 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o29CX2kG089529; Tue, 9 Mar 2010 12:33:02 GMT (envelope-from nobody) Message-Id: <201003091233.o29CX2kG089529@www.freebsd.org> Date: Tue, 9 Mar 2010 12:33:02 GMT From: Ganael Laplanche To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/144575: port fix: x11-toolkits/plib - Fix netSocket code X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2010 12:40:02 -0000 >Number: 144575 >Category: ports >Synopsis: port fix: x11-toolkits/plib - Fix netSocket code >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 09 12:40:02 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Ganael Laplanche >Release: 9.0-CURRENT >Organization: http://contribs.martymac.org >Environment: FreeBSD laptop.martymac.com 9.0-CURRENT FreeBSD 9.0-CURRENT #6: Thu Jan 21 14:46:32 UTC 2010 martymac@laptop.martymac.com:/usr/obj/usr/src/sys/GENERIC i386 >Description: This patch fixes socket handling for netSocket class in plib. As written in src/net/netSocket.h : /* DANGER!!! This MUST match 'struct sockaddr_in' exactly! */ the netAddress class should begin with the contents of 'struct sockaddr_in' *exactly*, because casts are performed using pointers. E.g. in src/net/netSocket.cxx : int netSocket::connect ( const char* host, int port ) { [...] netAddress addr ( host, port ) ; [...] return ::connect(handle,(const sockaddr*)&addr,sizeof(netAddress)); } This patch should fix any network-related application using the plib library (e.g. simgear). It closes ports/138786. As this lib is built as static, we should also bump PORTREVISIONs for dependent apps to make them update properly. >How-To-Repeat: >Fix: Patch attached with submission follows: diff -aurN plib.orig/Makefile plib/Makefile --- plib.orig/Makefile 2010-03-09 08:12:50.731527610 +0000 +++ plib/Makefile 2010-03-09 08:33:59.434649375 +0000 @@ -7,7 +7,7 @@ PORTNAME= plib PORTVERSION= 1.8.5 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11-toolkits MASTER_SITES= http://plib.sourceforge.net/dist/ diff -aurN plib.orig/files/patch-src-net-netSocket.h plib/files/patch-src-net-netSocket.h --- plib.orig/files/patch-src-net-netSocket.h 1970-01-01 00:00:00.000000000 +0000 +++ plib/files/patch-src-net-netSocket.h 2010-03-09 10:27:48.968986979 +0000 @@ -0,0 +1,27 @@ +--- src/net/netSocket.h.orig 2008-03-11 02:06:20.000000000 +0000 ++++ src/net/netSocket.h 2010-03-09 10:27:29.331029501 +0000 +@@ -41,6 +41,8 @@ + #define NET_SOCKET_H + + #include "ul.h" ++#include ++#include + #include + + /* +@@ -49,10 +51,11 @@ + 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 ] ; ++ int8_t sin_len; ++ sa_family_t sin_family; ++ in_port_t sin_port; ++ uint32_t sin_addr; ++ char sin_zero[8]; + + public: + netAddress () {} >Release-Note: >Audit-Trail: >Unformatted: