From nobody@FreeBSD.org  Sun Sep 30 05:17:47 2007
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 D8F2E16A418
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 30 Sep 2007 05:17:47 +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 D55CF13C467
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 30 Sep 2007 05:17:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l8U5HlO5008250
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 30 Sep 2007 05:17:47 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l8U5HloV008249;
	Sun, 30 Sep 2007 05:17:47 GMT
	(envelope-from nobody)
Message-Id: <200709300517.l8U5HloV008249@www.freebsd.org>
Date: Sun, 30 Sep 2007 05:17:47 GMT
From: Josh Carroll <josh.carroll@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ushare is broken for amd64
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: votdev@gmx.de

>Number:         116757
>Category:       ports
>Synopsis:       net/ushare is broken for amd64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    stefan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 30 05:20:01 GMT 2007
>Closed-Date:    Wed Oct 03 09:17:43 GMT 2007
>Last-Modified:  Wed Oct  3 09:20:02 GMT 2007
>Originator:     Josh Carroll
>Release:        6.2-RELEASE-p7 amd64
>Organization:
n/a
>Environment:
FreeBSD pflog.net 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #0: Sat Sep 29 14:50:41 EDT 2007     root@pflog.net:/usr/obj/usr/src/sys/PFLOG64  amd64

>Description:
The ushare port has a bug in the code that prevents it from working properly on an amd64 installation of 6.2-RELEASE.

When ushare is run, it fails with:

pflog# /usr/local/etc/rc.d/ushare start
Starting ushare.
sysctl: No such file or directory

I tracked this down to the sysctl calls in ushare.c, which are passing &len with len defined as an int. In fact, the compiler generates warnings for these:

ushare.c: In function `create_udn':
ushare.c:413: warning: passing arg 4 of `sysctl' from incompatible pointer type
ushare.c:420: warning: passing arg 4 of `sysctl' from incompatible pointer type

len should be of type size_t, not int. Defining len as size_t fixes the problem.

Thanks,
Josh
>How-To-Repeat:
cd /usr/ports/net/ushare
make && make install
/usr/local/etc/rc.d/ushare forcestart
>Fix:
Attached is a patch which changes the type of len from int to size_t in the create_udn function.

Patch attached with submission follows:

--- src/ushare.c.old	Sun Sep 30 01:03:37 2007
+++ src/ushare.c	Sun Sep 30 01:03:57 2007
@@ -386,7 +386,8 @@
   unsigned char *ptr;
 
 #if (defined(BSD) || defined(__FreeBSD__))
-  int mib[6], len;
+  int mib[6];
+  size_t len;
   struct if_msghdr *ifm;
   struct sockaddr_dl *sdl;
 #else /* Linux */


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sun Sep 30 05:31:18 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

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

From: "Volker Theile" <votdev@gmx.de>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/116757: net/ushare is broken for amd64
Date: Mon, 01 Oct 2007 08:28:35 +0200

 Hello Edwin,
 
 i approve the patch, so you can commit it finally.
 
 Greetings
 Volker
 
 -------- Original-Nachricht --------
 > Datum: Sun, 30 Sep 2007 05:31:15 UT
 > Von: Edwin Groothuis <edwin@FreeBSD.org>
 > An: votdev@gmx.de
 > Betreff: Re: ports/116757: net/ushare is broken for amd64
 
 > Maintainer of net/ushare,
 > 
 > Please note that PR ports/116757 has just been submitted.
 > 
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 > 
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/116757
 > 
 > -- 
 > Edwin Groothuis
 > edwin@FreeBSD.org
 
 -- 
 Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
 Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
State-Changed-From-To: feedback->open 
State-Changed-By: stefan 
State-Changed-When: Wed Oct 3 09:06:17 UTC 2007 
State-Changed-Why:  
Maintainer's feedback received. 


Responsible-Changed-From-To: freebsd-ports-bugs->stefan 
Responsible-Changed-By: stefan 
Responsible-Changed-When: Wed Oct 3 09:06:17 UTC 2007 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116757 
State-Changed-From-To: open->closed 
State-Changed-By: stefan 
State-Changed-When: Wed Oct 3 09:17:22 UTC 2007 
State-Changed-Why:  
Committed, thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/116757: commit references a PR
Date: Wed,  3 Oct 2007 09:14:28 +0000 (UTC)

 stefan      2007-10-03 09:14:22 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/ushare           Makefile 
   Added files:
     net/ushare/files     patch-src_ushare.c 
   Log:
   Make ushare work on amd64 by fixing a variable declaration.
   
   PR:             116757
   Submitted by:   Josh Carroll <josh.carroll@gmail.com>
   Approved by:    maintainer
   
   Revision  Changes    Path
   1.10      +1 -1      ports/net/ushare/Makefile
   1.1       +12 -0     ports/net/ushare/files/patch-src_ushare.c (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:
