ports/173543: net/ucarp / vlan interfaces
Alexey V. Degtyarev
alexey at renatasystems.org
Wed Feb 6 17:20:02 UTC 2013
The following reply was made to PR ports/173543; it has been noted by GNATS.
From: "Alexey V. Degtyarev" <alexey at renatasystems.org>
To: bug-followup at freebsd.org
Cc:
Subject: ports/173543: net/ucarp / vlan interfaces
Date: Wed, 6 Feb 2013 21:12:31 +0400
--xShVoZav8KYWC5Dk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Thanks!
The attached patch to net/ucarp to be committed.
Changes with 1.5.2_2:
* Fix error with VLAN interfaces on recent FreeBSD versions;
(thanks to Ingo Flaschberger <if at FreeBSD.org>)
* Update port's infrastructure to new OPTIONS;
* Make portlint happy with filenames in "files/";
--
Alexey V. Degtyarev
--xShVoZav8KYWC5Dk
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="ucarp-1.5.2_2.diff"
diff -Nru ucarp.orig/Makefile ucarp/Makefile
--- ucarp.orig/Makefile 2013-02-06 20:54:57.000000000 +0400
+++ ucarp/Makefile 2013-02-06 21:04:59.000000000 +0400
@@ -1,13 +1,9 @@
-# New ports collection makefile for: ucarp
-# Date created: 2005-05-06
-# Whom: Meno Abels <meno.abels at adviser.com>
-#
+# Created by: Meno Abels <meno.abels at adviser.com>
# $FreeBSD: head/net/ucarp/Makefile 300897 2012-07-14 14:29:18Z beat $
-#
PORTNAME= ucarp
PORTVERSION= 1.5.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net
MASTER_SITES= ftp://ftp.pureftpd.org/pub/pure-ftpd/misc/ucarp/ \
http://download.pureftpd.org/pub/ucarp/
@@ -17,9 +13,12 @@
USE_BZIP2= yes
-OPTIONS= UCARP_SCRIPTS "Install scripts to manage virtual IP" on
+OPTIONS_DEFINE= SCRIPTS
+OPTIONS_DEFAULT=SCRIPTS
-.include <bsd.port.pre.mk>
+SCRIPTS_DESC= Install scripts to manage virtual IP
+
+.include <bsd.port.options.mk>
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-nls
@@ -28,7 +27,7 @@
PLIST_FILES= sbin/ucarp
-.if defined(WITH_UCARP_SCRIPTS)
+.if ${PORT_OPTIONS:MSCRIPTS}
PLIST_FILES+= sbin/ucarp-up \
sbin/ucarp-down
post-install:
@@ -36,4 +35,4 @@
${INSTALL_SCRIPT} ${WRKSRC}/examples/bsd/vip-down.sh ${PREFIX}/sbin/ucarp-down
.endif
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -Nru ucarp.orig/files/patch-examples:bsd:vip-down.sh ucarp/files/patch-examples:bsd:vip-down.sh
--- ucarp.orig/files/patch-examples:bsd:vip-down.sh 2013-02-06 20:55:19.000000000 +0400
+++ ucarp/files/patch-examples:bsd:vip-down.sh 1970-01-01 03:00:00.000000000 +0300
@@ -1,24 +0,0 @@
---- examples/bsd/vip-down.sh.orig 2006-05-27 20:38:40.000000000 +0000
-+++ examples/bsd/vip-down.sh 2010-05-30 20:40:19.000000000 +0000
-@@ -1,4 +1,21 @@
- #! /bin/sh
-+
-+if [ -z "$1" -o -z "$2" ]; then
-+ cat <<EOF
-+Usage: ${0##*/} interface virtual-address [if-keep-ip]
-+ interface - interface name where virtual IP-address to be assigned;
-+ virtual-address - virtual IP-address;
-+ if-keep-ip - interface name where virtual IP-address should be kept
-+ when ucarp changes state to BACKUP;
-+
-+EOF
-+ exit 255
-+fi
-+
- exec 2> /dev/null
-
- /sbin/ifconfig "$1" -alias "$2"
-+
-+if [ ! -z "$3" ]; then
-+ /sbin/ifconfig "$3" alias "$2" netmask 255.255.255.255
-+fi
diff -Nru ucarp.orig/files/patch-examples:bsd:vip-up.sh ucarp/files/patch-examples:bsd:vip-up.sh
--- ucarp.orig/files/patch-examples:bsd:vip-up.sh 2013-02-06 20:55:13.000000000 +0400
+++ ucarp/files/patch-examples:bsd:vip-up.sh 1970-01-01 03:00:00.000000000 +0300
@@ -1,24 +0,0 @@
---- examples/bsd/vip-up.sh.orig 2006-05-27 20:38:34.000000000 +0000
-+++ examples/bsd/vip-up.sh 2010-05-30 20:40:19.000000000 +0000
-@@ -1,4 +1,21 @@
- #! /bin/sh
-+
-+if [ -z "$1" -o -z "$2" ]; then
-+ cat <<EOF
-+Usage: ${0##*/} interface virtual-address [if-keep-ip]
-+ interface - interface name where virtual IP-address to be assigned;
-+ virtual-address - virtual IP-address;
-+ if-keep-ip - interface name where virtual IP-address should be kept
-+ when ucarp changes state to BACKUP;
-+
-+EOF
-+ exit 255
-+fi
-+
- exec 2> /dev/null
-
-+if [ ! -z "$3" ]; then
-+ /sbin/ifconfig "$3" -alias "$2"
-+fi
-+
- /sbin/ifconfig "$1" alias "$2" netmask 255.255.255.255
diff -Nru ucarp.orig/files/patch-l2vlan ucarp/files/patch-l2vlan
--- ucarp.orig/files/patch-l2vlan 1970-01-01 03:00:00.000000000 +0300
+++ ucarp/files/patch-l2vlan 2013-02-06 20:31:45.000000000 +0400
@@ -0,0 +1,14 @@
+# http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/164060
+# http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/173543
+--- src/fillmac.c.orig 2007-07-04 15:34:59.000000000 +0200
++++ src/fillmac.c 2012-11-11 01:50:29.000000000 +0100
+@@ -86,7 +86,8 @@
+ if (strcmp(ifa->ifa_name, interface) == 0 &&
+ ifa->ifa_addr->sa_family == AF_LINK) {
+ sadl = (struct sockaddr_dl *) ifa->ifa_addr;
+- if (sadl == NULL || sadl->sdl_type != IFT_ETHER ||
++ if (sadl == NULL || ((sadl->sdl_type != IFT_ETHER) &&
++ (sadl->sdl_type != IFT_L2VLAN)) ||
+ sadl->sdl_alen <= 0) {
+ logfile(LOG_ERR,
+ _("Invalid media / hardware address for [%s]"),
diff -Nru ucarp.orig/files/patch-vip-down ucarp/files/patch-vip-down
--- ucarp.orig/files/patch-vip-down 1970-01-01 03:00:00.000000000 +0300
+++ ucarp/files/patch-vip-down 2013-02-05 18:57:01.000000000 +0400
@@ -0,0 +1,24 @@
+--- examples/bsd/vip-down.sh.orig 2006-05-27 20:38:40.000000000 +0000
++++ examples/bsd/vip-down.sh 2010-05-30 20:40:19.000000000 +0000
+@@ -1,4 +1,21 @@
+ #! /bin/sh
++
++if [ -z "$1" -o -z "$2" ]; then
++ cat <<EOF
++Usage: ${0##*/} interface virtual-address [if-keep-ip]
++ interface - interface name where virtual IP-address to be assigned;
++ virtual-address - virtual IP-address;
++ if-keep-ip - interface name where virtual IP-address should be kept
++ when ucarp changes state to BACKUP;
++
++EOF
++ exit 255
++fi
++
+ exec 2> /dev/null
+
+ /sbin/ifconfig "$1" -alias "$2"
++
++if [ ! -z "$3" ]; then
++ /sbin/ifconfig "$3" alias "$2" netmask 255.255.255.255
++fi
diff -Nru ucarp.orig/files/patch-vip-up ucarp/files/patch-vip-up
--- ucarp.orig/files/patch-vip-up 1970-01-01 03:00:00.000000000 +0300
+++ ucarp/files/patch-vip-up 2013-02-05 18:57:01.000000000 +0400
@@ -0,0 +1,24 @@
+--- examples/bsd/vip-up.sh.orig 2006-05-27 20:38:34.000000000 +0000
++++ examples/bsd/vip-up.sh 2010-05-30 20:40:19.000000000 +0000
+@@ -1,4 +1,21 @@
+ #! /bin/sh
++
++if [ -z "$1" -o -z "$2" ]; then
++ cat <<EOF
++Usage: ${0##*/} interface virtual-address [if-keep-ip]
++ interface - interface name where virtual IP-address to be assigned;
++ virtual-address - virtual IP-address;
++ if-keep-ip - interface name where virtual IP-address should be kept
++ when ucarp changes state to BACKUP;
++
++EOF
++ exit 255
++fi
++
+ exec 2> /dev/null
+
++if [ ! -z "$3" ]; then
++ /sbin/ifconfig "$3" -alias "$2"
++fi
++
+ /sbin/ifconfig "$1" alias "$2" netmask 255.255.255.255
--xShVoZav8KYWC5Dk--
More information about the freebsd-ports-bugs
mailing list