aboutsummaryrefslogtreecommitdiffstats
path: root/net/bird
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2011-06-03 03:52:40 +0800
committerpav <pav@FreeBSD.org>2011-06-03 03:52:40 +0800
commit009b159f9deb9cf1533dd81adbee303d32ff3c4f (patch)
treed05b72eb1d7009c18b12782629726cddf8595259 /net/bird
parent8a44022c04a572445f79f3d3a858d47ada0d34ea (diff)
downloadfreebsd-ports-gnome-009b159f9deb9cf1533dd81adbee303d32ff3c4f.tar.gz
freebsd-ports-gnome-009b159f9deb9cf1533dd81adbee303d32ff3c4f.tar.zst
freebsd-ports-gnome-009b159f9deb9cf1533dd81adbee303d32ff3c4f.zip
- Update to 1.3.1
- Add optional patches (to ipv4 port) to enable multiple fibs support, and to enable a simultaneous operation with other routing software - Sign over a maintainership to an enthusiastic user PR: ports/157001 Submitted by: Alexander V. Chernikov <melifaro@ipfw.ru>
Diffstat (limited to 'net/bird')
-rw-r--r--net/bird/Makefile19
-rw-r--r--net/bird/distinfo4
-rw-r--r--net/bird/files/fibs.diff126
-rw-r--r--net/bird/files/learn-krt-sock.c11
4 files changed, 155 insertions, 5 deletions
diff --git a/net/bird/Makefile b/net/bird/Makefile
index 28a8012e1c94..d98ad44093f5 100644
--- a/net/bird/Makefile
+++ b/net/bird/Makefile
@@ -6,24 +6,37 @@
#
PORTNAME= bird
-PORTVERSION= 1.3.0
+PORTVERSION= 1.3.1
CATEGORIES= net
MASTER_SITES= ftp://bird.network.cz/pub/bird/
-MAINTAINER= pav@FreeBSD.org
+MAINTAINER= melifaro@ipfw.ru
COMMENT= Dynamic IP routing daemon (IPv4 version)
USE_BISON= build
USE_GMAKE= yes
GNU_CONFIGURE= yes
+OPTIONS= FIBS "Enable multiple fib support" Off \
+ LEARN_FIX "Support multiple routing daemons" Off
+
MAKE_JOBS_UNSAFE= yes
USE_RC_SUBR= bird
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_FIBS)
+EXTRA_PATCHES+= ${FILESDIR}/fibs.diff
+.endif
+
+.if defined(WITH_LEARN_FIX)
+EXTRA_PATCHES+= ${FILESDIR}/learn-krt-sock.c
+.endif
+
post-install:
@if [ ! -f ${PREFIX}/etc/bird.conf ]; then \
${CP} -p ${PREFIX}/etc/bird.conf.example ${PREFIX}/etc/bird.conf ; \
fi
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/net/bird/distinfo b/net/bird/distinfo
index 9953c0cadb82..acf10134a907 100644
--- a/net/bird/distinfo
+++ b/net/bird/distinfo
@@ -1,2 +1,2 @@
-SHA256 (bird-1.3.0.tar.gz) = ff90e3ee115a83e2b03a57095132923f66e1fca874dcca7a908075b6c2dc84b3
-SIZE (bird-1.3.0.tar.gz) = 735100
+SHA256 (bird-1.3.1.tar.gz) = 848be209aba6a1a85ae0ed6192710f8bcc2f1257068191fe2959398cdec01afb
+SIZE (bird-1.3.1.tar.gz) = 826422
diff --git a/net/bird/files/fibs.diff b/net/bird/files/fibs.diff
new file mode 100644
index 000000000000..c2810c6c9672
--- /dev/null
+++ b/net/bird/files/fibs.diff
@@ -0,0 +1,126 @@
+diff -urN sysdep/bsd/Modules sysdep/bsd/Modules
+--- sysdep/bsd/Modules 2011-03-31 12:29:42.000000000 +0400
++++ sysdep/bsd/Modules 2011-05-10 12:04:30.643950460 +0400
+@@ -4,3 +4,4 @@
+ krt-set.h
+ krt-sock.c
+ krt-sock.h
++fib.Y
+diff -urN sysdep/bsd/fib.Y sysdep/bsd/fib.Y
+--- sysdep/bsd/fib.Y 1970-01-01 03:00:00.000000000 +0300
++++ sysdep/bsd/fib.Y 2011-05-10 12:04:05.724272679 +0400
+@@ -0,0 +1,29 @@
++/*
++ * BIRD -- FreeBSD rtsock configuration
++ *
++ * (c) 2011 Alexander V. Chernikov
++ *
++ * Can be freely distributed and used under the terms of the GNU GPL.
++ */
++
++CF_HDR
++
++CF_DECLS
++
++CF_KEYWORDS(ASYNC, KERNEL, TABLE, KRT_PREFSRC, KRT_REALM)
++
++CF_GRAMMAR
++
++CF_ADDTO(kern_proto, kern_proto rtsock_item ';')
++
++rtsock_item:
++ KERNEL TABLE expr {
++ if ($3 <= 0 || $3 >= max_fib_num())
++ cf_error("Kernel routing table number out of range");
++ THIS_KRT->scan.table_id = $3;
++ }
++ ;
++
++CF_CODE
++
++CF_END
+diff -urN sysdep/bsd/krt-scan.h sysdep/bsd/krt-scan.h
+--- sysdep/bsd/krt-scan.h 2011-03-31 12:29:42.000000000 +0400
++++ sysdep/bsd/krt-scan.h 2011-05-10 11:58:54.812942887 +0400
+@@ -10,6 +10,7 @@
+ #define _BIRD_KRT_SCAN_H_
+
+ struct krt_scan_params {
++ int table_id; /* Kernel table ID we sync with */
+ };
+
+ struct krt_scan_status {
+diff -urN sysdep/bsd/krt-sock.c sysdep/bsd/krt-sock.c
+--- sysdep/bsd/krt-sock.c 2011-05-02 12:13:18.000000000 +0400
++++ sysdep/bsd/krt-sock.c 2011-05-10 12:25:22.075267568 +0400
+@@ -53,6 +53,21 @@
+ );
+ }
+
++int
++max_fib_num()
++{
++ int fibs = 1;
++ size_t fibs_len = sizeof(fibs);
++ if (sysctlbyname("net.fibs", &fibs, &fibs_len, NULL, 0) == -1)
++ {
++ log(L_ERR "KRT: unable to get fib number, assuming 1. error: %s", strerror(errno));
++ return 1;
++ }
++
++ log(L_TRACE "Max fibs: %d\n", fibs);
++ return fibs;
++}
++
+ #define ROUNDUP(a) \
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+
+@@ -219,6 +234,7 @@
+ {
+ sock *sk_rt;
+ static int ks_open_tried = 0;
++ int fib = 0;
+
+ if (ks_open_tried)
+ return;
+@@ -230,6 +246,16 @@
+ if( (rt_sock = socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC)) < 0)
+ die("Cannot open kernel socket for routes");
+
++ fib = ((struct krt_config *)x)->scan.table_id;
++ log(L_TRACE "KRT: Setting fib %d", fib);
++
++
++ if ((fib != 0) && (setsockopt(rt_sock, SOL_SOCKET, SO_SETFIB, &fib, sizeof(fib)) == -1))
++ {
++ log(L_ERR "KRT: setsockopt() failed for socket %d: %s", rt_sock, strerror(errno));
++ die("Cannot set fib for kernel socket");
++ }
++
+ sk_rt = sk_new(krt_pool);
+ sk_rt->type = SK_MAGIC;
+ sk_rt->rx_hook = krt_set_hook;
+diff -urN sysdep/cf/bsd-v6.h sysdep/cf/bsd-v6.h
+--- sysdep/cf/bsd-v6.h 2011-03-31 12:29:42.000000000 +0400
++++ sysdep/cf/bsd-v6.h 2011-05-10 11:19:01.394166479 +0400
+@@ -10,7 +10,7 @@
+
+ #define CONFIG_AUTO_ROUTES
+ #define CONFIG_SELF_CONSCIOUS
+-#undef CONFIG_MULTIPLE_TABLES
++#define CONFIG_MULTIPLE_TABLES
+
+ #undef CONFIG_UNIX_IFACE
+ #undef CONFIG_UNIX_SET
+diff -urN sysdep/cf/bsd.h sysdep/cf/bsd.h
+--- sysdep/cf/bsd.h 2011-03-31 12:29:42.000000000 +0400
++++ sysdep/cf/bsd.h 2011-05-10 11:19:01.398182352 +0400
+@@ -8,7 +8,7 @@
+
+ #define CONFIG_AUTO_ROUTES
+ #define CONFIG_SELF_CONSCIOUS
+-#undef CONFIG_MULTIPLE_TABLES
++#define CONFIG_MULTIPLE_TABLES
+
+ #undef CONFIG_UNIX_IFACE
+ #undef CONFIG_UNIX_SET
diff --git a/net/bird/files/learn-krt-sock.c b/net/bird/files/learn-krt-sock.c
new file mode 100644
index 000000000000..ed4bfac9f390
--- /dev/null
+++ b/net/bird/files/learn-krt-sock.c
@@ -0,0 +1,11 @@
+--- sysdep/bsd/krt-sock.c.orig 2011-05-11 10:41:35.432219356 +0400
++++ sysdep/bsd/krt-sock.c 2011-05-11 10:42:02.483875083 +0400
+@@ -320,7 +320,7 @@
+ if ((flags & RTF_GATEWAY) && ipa_zero(igate))
+ { log(L_ERR "%s (%I/%d) - missing gateway", errmsg, idst, pxlen); return; }
+
+- u32 self_mask = RTF_PROTO1;
++ u32 self_mask = 0;
+ u32 alien_mask = RTF_STATIC | RTF_PROTO1 | RTF_GATEWAY;
+
+ #ifdef RTF_PROTO2