Bug 137195 - [PATCH] [UNBREAK] unbreak net/ladvd on FreeBSD/amd64
Summary: [PATCH] [UNBREAK] unbreak net/ladvd on FreeBSD/amd64
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-28 02:10 UTC by Xin LI
Modified: 2009-07-29 06:59 UTC (History)
1 user (show)

See Also:


Attachments
ladvd-amd64.diff (970 bytes, patch)
2009-07-28 02:10 UTC, Xin LI
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xin LI freebsd_committer freebsd_triage 2009-07-28 02:10:00 UTC
	ladvd's configure script seems to be unable to detect the
platform correctly, i.e. it uses the Linux-ish x86_64 instead of
the FreeBSD style 'amd64' naming.

How-To-Repeat: 	build ladvd on FreeBSD/amd64.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-07-28 02:10:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->delphij

Submitter has GNATS access (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2009-07-28 02:10:13 UTC
Maintainer of net/ladvd,

Please note that PR ports/137195 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/137195

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2009-07-28 02:10:17 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 sten 2009-07-28 06:59:36 UTC
On Tue, 28 Jul 2009, Edwin Groothuis wrote:

> Maintainer of net/ladvd,
>
> Please note that PR ports/137195 has just been submitted.
>

Upstream has a slightly different patch which disables PIE
completely on FreeBSD. The code itself has been tested on
arm / sparc / vax / amd64 and should be fine. Its the compiler
flags which cause it to break on certain FreeBSD platforms.

I'd like to propose the following diff which backports the PIE
related configure changes from upstream, and fixes some lagg ioctl's:
And as a bonus fixes the other open ladvd pr.

--- Makefile.orig	2009-07-28 07:54:50.000000000 +0200
+++ Makefile	2009-07-28 07:57:45.000000000 +0200
@@ -7,6 +7,7 @@

  PORTNAME=	ladvd
  PORTVERSION=	0.8
+PORTREVISION=	1
  CATEGORIES=	net
  MASTER_SITES=	http://blinkenlights.nl/software/ladvd/

@@ -15,9 +16,8 @@

  LIB_DEPENDS=	event-1.4:${PORTSDIR}/devel/libevent

-ONLY_FOR_ARCHS=	i386
-
  GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--with-chroot-dir=/var/empty

  PORTDOCS=	*
  MAN8=		ladvd.8
diff -N files/patch-backport
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-backport	28 Jul 2009 00:58:13 -0000
@@ -0,0 +1,83 @@
+--- src/netif.c	2009-06-21 21:36:07.000000000 +0200
++++ src/netif.c	2009-07-24 07:53:48.000000000 +0200
+@@ -399,6 +403,12 @@
+     memset(&drvinfo, 0, sizeof(drvinfo));
+ #endif
+ 
++#ifdef HAVE_NET_IF_LAGG_H
++    struct lagg_reqall ra;
++#elif HAVE_NET_IF_TRUNK_H
++    struct trunk_reqall ra;
++#endif
++
+ #ifdef HAVE_SYSFS
+     if (snprintf(path, SYSFS_PATH_MAX,
+ 	    SYSFS_CLASS_NET "/%s/device", ifaddr->ifa_name) > 0) {
+@@ -442,13 +452,17 @@
+     if (if_data->ifi_type == IFT_ETHER) {
+ 
+ 	// bonding
++#if defined(HAVE_NET_IF_LAGG_H) || defined(HAVE_NET_IF_TRUNK_H)
++	memset(&ra, 0, sizeof(ra));
++	strlcpy(ra.ra_ifname, ifaddr->ifa_name, sizeof(ra.ra_ifname));
+ #ifdef HAVE_NET_IF_LAGG_H
+-	if (ioctl(sockfd, SIOCGLAGG, (caddr_t)ifr) >= 0)
++	if (ioctl(sockfd, SIOCGLAGG, &ra) >= 0)
+ 	    return(NETIF_BONDING);
+ #elif HAVE_NET_IF_TRUNK_H
+-	if (ioctl(sockfd, SIOCGTRUNK, (caddr_t)ifr) == 0)
++	if (ioctl(sockfd, SIOCGTRUNK, &ra) == 0)
+ 	    return(NETIF_BONDING);
+ #endif
++#endif
+ 
+ 	// accept regular devices
+ 	return(NETIF_REGULAR);
+@@ -459,8 +473,9 @@
+ 	return(NETIF_BRIDGE);
+ #endif
+ #ifdef IFT_IEEE8023ADLAG
++    // trunk ports have a special type
+     } else if (if_data->ifi_type == IFT_IEEE8023ADLAG) {
+-	return(NETIF_BONDING);
++	return(NETIF_REGULAR);
+ #endif
+     }
+ 
+@@ -618,7 +633,7 @@
+ 	    my_log(INFO, "found slave %s", subif->name);
+ 	    subif->slave = 1;
+ 	    subif->master = master;
+-	    subif->lacp_index = i++;
++	    subif->lacp_index = i;
+ 	    csubif->subif = subif;
+ 	    csubif = subif;
+ 	}
+--- configure.orig	2009-06-21 21:44:00.000000000 +0200
++++ configure	2009-07-28 07:42:56.000000000 +0200
+@@ -20062,15 +20062,12 @@
+ 
+ 	;;
+     freebsd*)
+-	case "$target" in
+-	    x86_64-*-freebsd7.*)
+-		use_pie=no
+-	esac
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define TARGET_IS_FREEBSD 1
+ _ACEOF
+ 
++	use_pie=no
+ 	;;
+     openbsd*)
+ 
+@@ -20479,7 +20476,7 @@
+ { echo "$as_me:$LINENO: result: $ssp_cv_cc" >&5
+ echo "${ECHO_T}$ssp_cv_cc" >&6; }
+     if test $ssp_cv_cc = yes; then
+-      WFLAGS="$WFLAGS -fstack-protector"
++      WCFLAGS="$WCFLAGS -fstack-protector"
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define ENABLE_SSP_CC 1

-- 
Sten Spans

"There is a crack in everything, that's how the light gets in."
Leonard Cohen - Anthem
Comment 5 Xin LI freebsd_committer freebsd_triage 2009-07-29 06:58:56 UTC
State Changed
From-To: feedback->closed

Maintainer patch applied.