[gentoo-commits] repo/gentoo:master commit in: net-misc/quagga/files/, net-misc/quagga/, profiles/, ...

2021-12-22 Thread Jakov Smolić
commit: a0b4caeebfee75547a7525cbe8c3a112402ed395
Author: Jakov Smolić  gentoo  org>
AuthorDate: Wed Dec 22 11:19:51 2021 +
Commit: Jakov Smolić  gentoo  org>
CommitDate: Wed Dec 22 11:23:03 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0b4caee

net-misc/quagga: treeclean

Bug: https://bugs.gentoo.org/825358
Signed-off-by: Jakov Smolić  gentoo.org>

 net-misc/quagga/Manifest   |   2 -
 .../files/quagga-0.99.22.4-ipctl-forwarding.patch  |  22 
 net-misc/quagga/files/quagga-services.init.3   |  43 ---
 net-misc/quagga/files/quagga.pam   |  26 
 net-misc/quagga/files/systemd/bgpd.service |  16 ---
 net-misc/quagga/files/systemd/isisd.service|  16 ---
 net-misc/quagga/files/systemd/nhrpd.service|  16 ---
 net-misc/quagga/files/systemd/ospf6d.service   |  16 ---
 net-misc/quagga/files/systemd/ospfd.service|  16 ---
 net-misc/quagga/files/systemd/pimd.service |  17 ---
 net-misc/quagga/files/systemd/quagga.conf  |   1 -
 net-misc/quagga/files/systemd/ripd.service |  16 ---
 net-misc/quagga/files/systemd/ripngd.service   |  16 ---
 net-misc/quagga/files/systemd/zebra.service|  16 ---
 net-misc/quagga/metadata.xml   |  53 
 net-misc/quagga/quagga-1.2.4-r2.ebuild | 135 -
 profiles/package.mask  |   7 --
 17 files changed, 434 deletions(-)

diff --git a/net-misc/quagga/Manifest b/net-misc/quagga/Manifest
deleted file mode 100644
index 579eea17a844..
--- a/net-misc/quagga/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST ht-20040304-classless-bgp.patch 1581 BLAKE2B 
64df9a86c235c4f6d35be0f19fe1b056958ae2fa28bd2e9e8d9902e569a8f9a2925ba45396bb92e345bfcaf8ca1ef9136a433c615a5bd12a279e7c062939549a
 SHA512 
3df102d8ab88aaee1f109a2310602d6f734f2268252e5e42df752df7db7abeac526e969289481c4abfe905dcd41c35dee65196c48ac320fe9d083305451476e8
-DIST quagga-1.2.4.tar.gz 2925847 BLAKE2B 
e0e8d8b8e2243bc5cecc2e66d26040780f839414a16fb8a719d25a6fe1c29dc8545a92700a3758100715e1efb3d874584903885af51ef9f5d88c4a02d02dbc74
 SHA512 
3e72440bcccfd3c1a449a62b7ff8623441256399a2bee0a39fa0a19694a5a78ac909c5c2128a24735bc034ea8b0811827293b480a2584a3a4c8ae36be9cf1fcd

diff --git a/net-misc/quagga/files/quagga-0.99.22.4-ipctl-forwarding.patch 
b/net-misc/quagga/files/quagga-0.99.22.4-ipctl-forwarding.patch
deleted file mode 100644
index f6b726b591f7..
--- a/net-misc/quagga/files/quagga-0.99.22.4-ipctl-forwarding.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Fix for missing definitions on some Hardened configurations
-Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=437292
-
-diff -Naur quagga-0.99.16.orig/zebra/ipforward_sysctl.c 
quagga-0.99.16/zebra/ipforward_sysctl.c
 quagga-0.99.16.orig/zebra/ipforward_sysctl.c   2010-03-11 
12:11:32.0 -0500
-+++ quagga-0.99.16/zebra/ipforward_sysctl.c2010-03-11 12:11:39.0 
-0500
-@@ -31,6 +31,15 @@
- 
- #define MIB_SIZ 4
- 
-+/* Fix for recent (2.6.14) kernel headers */
-+#ifndef IPCTL_FORWARDING
-+#define IPCTL_FORWARDING   NET_IPV4_FORWARD
-+#endif
-+
-+#ifndef IP6CTL_FORWARDING
-+#define IP6CTL_FORWARDING  NET_IPV6_FORWARDING
-+#endif
-+
- extern struct zebra_privs_t zserv_privs;
- 
- /* IPv4 forwarding control MIB. */

diff --git a/net-misc/quagga/files/quagga-services.init.3 
b/net-misc/quagga/files/quagga-services.init.3
deleted file mode 100644
index e613b26abb03..
--- a/net-misc/quagga/files/quagga-services.init.3
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-: ${CFGFILE:=/etc/quagga/${SVCNAME}.conf}
-
-pidfile=/run/quagga/${SVCNAME}.pid
-
-command=/usr/sbin/${SVCNAME}
-command_args="-d -f ${CFGFILE} ${EXTRA_OPTS} --pid_file ${pidfile}"
-
-get_service_config() {
-   [ -e "$CFGFILE" ] || return
-
-   awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE"
-}
-
-depend() {
-   config "$CFGFILE"
-
-[ ${SVCNAME} = "zebra" ] && need net || need zebra
-
-   [ "$(get_service_config log)" = "syslog" ] && \
-   use logger
-}
-
-start_pre() {
-if [ ! -e "${CFGFILE}" ] ; then
-eerror "Before starting ${SVCNAME} you have to configure it, by 
creating"
-eerror "a ${CFGFILE} file."
-eerror ""
-eerror "A sample file has been installed in `echo 
/usr/share/doc/quagga-*/samples/${SVCNAME}.conf.sample*`"
-return 1
-fi
-
-   checkpath -d -m 0750 -o quagga:quagga /run/quagga
-
-   if [ ${SVCNAME} = "zebra" ]; then
-   ebegin "Cleaning up stale zebra routes..."
-   ip route flush proto zebra
-   eend $?
-   fi
-}

diff --git a/net-misc/quagga/files/quagga.pam b/net-misc/quagga/files/quagga.pam
deleted file mode 100644
index 9a91ad852fbd..
--- 

[gentoo-commits] repo/gentoo:master commit in: net-misc/quagga/files/, net-misc/quagga/

2018-01-25 Thread Sergey Popov
commit: ab71ee7a03166f69b15849ab336ed5056aa0b8d0
Author: Sergey Popov  gentoo  org>
AuthorDate: Thu Jan 25 16:03:14 2018 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Thu Jan 25 16:03:28 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab71ee7a

net-misc/quagga: revision bump

Backport fixes for test failures on sparc and incorrect ipv6 route handling

Closes: https://bugs.gentoo.org/638906
Closes: https://bugs.gentoo.org/641736

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 net-misc/quagga/files/quagga-1.2.2-ipv6-bgp.patch  |  42 +++
 .../quagga/files/quagga-1.2.2-sparc-tests.patch|  31 +
 net-misc/quagga/quagga-1.2.2-r1.ebuild | 137 +
 3 files changed, 210 insertions(+)

diff --git a/net-misc/quagga/files/quagga-1.2.2-ipv6-bgp.patch 
b/net-misc/quagga/files/quagga-1.2.2-ipv6-bgp.patch
new file mode 100644
index 000..0ee5f322f76
--- /dev/null
+++ b/net-misc/quagga/files/quagga-1.2.2-ipv6-bgp.patch
@@ -0,0 +1,42 @@
+commit 1db1b9baea511995b67a9b282d5c97e87479fe5d
+Author: Mathieu Jadin 
+Date:   Thu Dec 14 17:53:53 2017 +0100
+
+bgpd: Fix mistake in NHT of connected IPv6 next-hops preventing route 
advertisement
+
+Since quagga-1.2.0, the Next Hop validation for directly connected peers
+using IPv6 does not work.
+
+In this setup, BGP updates contain two next hops: a global IPv6 address and
+a link-local IPv6 address (a correct behavior according to RFC 2545).  This
+means that the length of the next hop attribute is 32 and not 16.
+
+The problem comes from the function "make_prefix()" in "bgpd/bgp_nht.c".  
It
+refuses to build a prefix structure for a route when the length of the
+[Anext hop attribute is different from 16, even if a valid global IPv6
+address is available.
+
+The route is mistakenly considered invalid and thus, it is not installed in
+the routing table.
+
+Details: "make_prefix()" was not modified in quagga-1.2.0 but its
+interpretation was changed in commit
+3dda6b3eccb9a2a88d607372c83c04c796e7daac.  Before this commit, the failure
+of "make_prefix()" was interpreted as a successful validation of the next
+hop.
+
+diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c
+index 1158ab15..d734c201 100644
+--- a/bgpd/bgp_nht.c
 b/bgpd/bgp_nht.c
+@@ -409,8 +409,8 @@ make_prefix (int afi, struct bgp_info *ri, struct prefix 
*p)
+   break;
+ #ifdef HAVE_IPV6
+ case AFI_IP6:
+-  if (ri->attr->extra->mp_nexthop_len != 16
+-|| IN6_IS_ADDR_LINKLOCAL (>attr->extra->mp_nexthop_global))
++  if (ri->attr->extra->mp_nexthop_len == 16
++&& IN6_IS_ADDR_LINKLOCAL (>attr->extra->mp_nexthop_global))
+   return -1;
+ 
+   p->family = AF_INET6;

diff --git a/net-misc/quagga/files/quagga-1.2.2-sparc-tests.patch 
b/net-misc/quagga/files/quagga-1.2.2-sparc-tests.patch
new file mode 100644
index 000..054d15f0355
--- /dev/null
+++ b/net-misc/quagga/files/quagga-1.2.2-sparc-tests.patch
@@ -0,0 +1,31 @@
+commit adda534f95ec87206c9dfd1b3bae05221dc29730
+Author: Rolf Eike Beer 
+Date:   Mon Dec 4 18:36:21 2017 +0100
+
+bgpd: fix SIGBUS
+
+There is one test failure in the testsuite on sparc:
+
+Running ./bgpd.tests/testbgpcap.exp ...
+failed: testbgpcap ORF: ORF, simple, single entry, single tuple -- 
testbgpcap  aborted!
+
+The error is a SIGBUS in bgp_capability_mp_data() because of an unaligned
+memory access.  Use memcpy() instead of direct assignments.  Compilers on
+platforms that support unaligned accesses should be clever enough to
+optimize the function call away and do the direct store, so this should not
+hurt there.
+
+diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
+index 28004230..d9ec4bef 100644
+--- a/bgpd/bgp_open.c
 b/bgpd/bgp_open.c
+@@ -120,7 +120,8 @@ bgp_capability_vty_out (struct vty *vty, struct peer *peer)
+ static void 
+ bgp_capability_mp_data (struct stream *s, struct capability_mp_data *mpc)
+ {
+-  mpc->afi = stream_getw (s);
++  afi_t afi = stream_getw (s);
++  memcpy(>afi, , sizeof(mpc->afi));
+   mpc->reserved = stream_getc (s);
+   mpc->safi = stream_getc (s);
+ }

diff --git a/net-misc/quagga/quagga-1.2.2-r1.ebuild 
b/net-misc/quagga/quagga-1.2.2-r1.ebuild
new file mode 100644
index 000..5e0fc3e952d
--- /dev/null
+++ b/net-misc/quagga/quagga-1.2.2-r1.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+CLASSLESS_BGP_PATCH=ht-20040304-classless-bgp.patch
+
+inherit autotools eutils flag-o-matic multilib pam readme.gentoo-r1 systemd 
tmpfiles user
+
+DESCRIPTION="A free routing daemon replacing Zebra supporting RIP, OSPF and 
BGP"
+HOMEPAGE="http://quagga.net/;
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz
+   bgpclassless? ( 

[gentoo-commits] repo/gentoo:master commit in: net-misc/quagga/files/, net-misc/quagga/

2017-01-24 Thread Sergey Popov
commit: 20a70440a3d662b3f1fe250f5b9194aab0f3eae9
Author: Sergey Popov  gentoo  org>
AuthorDate: Tue Jan 24 10:34:13 2017 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Tue Jan 24 10:35:52 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20a70440

net-misc/quagga: fix quoting in eapply call, security cleanup

Gentoo-Bug: 581526

Package-Manager: portage-2.3.3

 net-misc/quagga/Manifest   |   1 -
 .../quagga-1.0.20160315-bgpd-logging-fix.patch |  30 -
 ...a-1.0.20160315-ospfd-dangling-pointer-fix.patch | 134 
 ...quagga-1.0.20160315-ripd-null-pointer-fix.patch |  40 --
 ...uagga-1.0.20160315-zebra-ipv6-ra-overflow.patch |  48 
 net-misc/quagga/quagga-1.0.20160315-r4.ebuild  | 137 -
 net-misc/quagga/quagga-1.1.0-r2.ebuild |   2 +-
 7 files changed, 1 insertion(+), 391 deletions(-)

diff --git a/net-misc/quagga/Manifest b/net-misc/quagga/Manifest
index ee21e46..ed50e66 100644
--- a/net-misc/quagga/Manifest
+++ b/net-misc/quagga/Manifest
@@ -1,3 +1,2 @@
 DIST ht-20040304-classless-bgp.patch 1581 SHA256 
39993890f9e31d662ed0564c732fb22392a901beb45b64261ffeadd9edf27887 SHA512 
3df102d8ab88aaee1f109a2310602d6f734f2268252e5e42df752df7db7abeac526e969289481c4abfe905dcd41c35dee65196c48ac320fe9d083305451476e8
 WHIRLPOOL 
cef99d64d52ab8c28bd672fb93dfbd8d716a31c76a5403496a6d104a5ff39531d6085134124d41fe4ff7adf895fa001cbe77b6e42846d849d6c108c81583d04e
-DIST quagga-1.0.20160315.tar.xz 1819488 SHA256 
d284af5dd875dbba90ab875d40db5d68fdc9ede17a76f2af525f85344be56767 SHA512 
ad633d189017a2cef68cf1653b85e082a0dc4fe146720a985da8cdf2aa4c61f2df8a8339419c986e9d74aa88f7f7109bc6d0c13d9ff4904a23852cee3e112edc
 WHIRLPOOL 
6f0ac5da5fef382cf7a462f8d2c139bb0d8068e7b772cd48b63aa0752098515d6b5eb9a10a4e1fc7021085e0635248f6075d937901c6207d51bd0f284388541c
 DIST quagga-1.1.0.tar.gz 2870278 SHA256 
f7a43a9c59bfd3722002210530b2553c8d5cc05bfea5acd56d4f102b9f55dc63 SHA512 
3b29a90c4f05593714bda3c702fd2c8886ce48fba2fbfb98f55cc04d1025edd5427944e9a9fb7cd630e5e8ccea388b72a8e611ab65c370e760f3f319d03f090f
 WHIRLPOOL 
ee4a78b1d20aa9e7e7aea1f0be2adee83efa0fd47a807a4ec1affb1e059fee156861b612f73716cbf80e96cc6676baed062b9440ea7664198078cd6760380573

diff --git a/net-misc/quagga/files/quagga-1.0.20160315-bgpd-logging-fix.patch 
b/net-misc/quagga/files/quagga-1.0.20160315-bgpd-logging-fix.patch
deleted file mode 100644
index 7c7f54c..
--- a/net-misc/quagga/files/quagga-1.0.20160315-bgpd-logging-fix.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
-index 740b0f1..9cbb5b5 100644
 a/bgpd/bgp_packet.c
-+++ b/bgpd/bgp_packet.c
-@@ -1631,7 +1631,7 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
- NLRI_TYPE_MAX,
-   };
-   struct bgp_nlri nlris[NLRI_TYPE_MAX];
--
-+  
-   /* Status must be Established. */
-   if (peer->status != Established) 
- {
-@@ -1645,6 +1645,7 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
-   memset (, 0, sizeof (struct attr));
-   memset (, 0, sizeof (struct attr_extra));
-   memset (, 0, sizeof nlris);
-+  
-   attr.extra = 
- 
-   s = peer->ibuf;
-@@ -1781,6 +1782,8 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
-   /* Parse any given NLRIs */
-   for (i = NLRI_UPDATE; i < NLRI_TYPE_MAX; i++)
- {
-+  if (!nlris[i].nlri) continue;
-+  
-   /* We use afi and safi as indices into tables and what not.  It would
-* be impossible, at this time, to support unknown afi/safis.  And
-* anyway, the peer needs to be configured to enable the afi/safi

diff --git 
a/net-misc/quagga/files/quagga-1.0.20160315-ospfd-dangling-pointer-fix.patch 
b/net-misc/quagga/files/quagga-1.0.20160315-ospfd-dangling-pointer-fix.patch
deleted file mode 100644
index cc24fba..
--- a/net-misc/quagga/files/quagga-1.0.20160315-ospfd-dangling-pointer-fix.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-From bb01bdd740339b0c07d8ed0786811801b2a79192 Mon Sep 17 00:00:00 2001
-From: Jafar Al-Gharaibeh 
-Date: Thu, 21 Apr 2016 21:22:33 +
-Subject: ospfd: fix - correct neighbor index on changing/p2p/virtual links
-
-ospfd keeps a list of neighbor routers for each configured interface. This
- list is indexed using the neighbor router id in case of point-to-point and
- virtual link types, otherwise the list is indexed using the neighbor's
- source IP (RFC 2328, page 96). The router adds itself as a "pseudo" neighbor
- on each link, and also keeps a pointer called (nbr_self) to the neighbor
- structure. This takes place when the interface is first configured. Currently
- ospfd adds this pseudo neighbor before the link parameters are fully 
configure,
- including whether the link type is point-to-point or virtual link. This causes
- the pseudo neighbor to be always indexed using the source IP address 
regardless
- of th link type. For point-to-point and virtual links, this causes the lookup
- for the 

[gentoo-commits] repo/gentoo:master commit in: net-misc/quagga/files/, net-misc/quagga/

2016-08-13 Thread Sergey Popov
commit: 1d77537a3d59537cb413358bbd23714fe8a8776a
Author: Sergey Popov  gentoo  org>
AuthorDate: Sat Aug 13 07:16:13 2016 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Sat Aug 13 07:16:13 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d77537a

net-misc/quagga: revision bump

Currently, bgpd logs enormous amount of errors about
AFI/SAFI does not set, which is wrong, so we should
backport upstream patch to fix this

Reported-by: Arnaud Launay  launay.org>
Gentoo-Bug: 589946

Package-Manager: portage-2.3.0

 .../quagga-1.0.20160315-bgpd-logging-fix.patch |  30 +
 net-misc/quagga/quagga-1.0.20160315-r3.ebuild  | 136 +
 2 files changed, 166 insertions(+)

diff --git a/net-misc/quagga/files/quagga-1.0.20160315-bgpd-logging-fix.patch 
b/net-misc/quagga/files/quagga-1.0.20160315-bgpd-logging-fix.patch
new file mode 100644
index 000..7c7f54c
--- /dev/null
+++ b/net-misc/quagga/files/quagga-1.0.20160315-bgpd-logging-fix.patch
@@ -0,0 +1,30 @@
+diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
+index 740b0f1..9cbb5b5 100644
+--- a/bgpd/bgp_packet.c
 b/bgpd/bgp_packet.c
+@@ -1631,7 +1631,7 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
+ NLRI_TYPE_MAX,
+   };
+   struct bgp_nlri nlris[NLRI_TYPE_MAX];
+-
++  
+   /* Status must be Established. */
+   if (peer->status != Established) 
+ {
+@@ -1645,6 +1645,7 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
+   memset (, 0, sizeof (struct attr));
+   memset (, 0, sizeof (struct attr_extra));
+   memset (, 0, sizeof nlris);
++  
+   attr.extra = 
+ 
+   s = peer->ibuf;
+@@ -1781,6 +1782,8 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
+   /* Parse any given NLRIs */
+   for (i = NLRI_UPDATE; i < NLRI_TYPE_MAX; i++)
+ {
++  if (!nlris[i].nlri) continue;
++  
+   /* We use afi and safi as indices into tables and what not.  It would
+* be impossible, at this time, to support unknown afi/safis.  And
+* anyway, the peer needs to be configured to enable the afi/safi

diff --git a/net-misc/quagga/quagga-1.0.20160315-r3.ebuild 
b/net-misc/quagga/quagga-1.0.20160315-r3.ebuild
new file mode 100644
index 000..5af09fe
--- /dev/null
+++ b/net-misc/quagga/quagga-1.0.20160315-r3.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+CLASSLESS_BGP_PATCH=ht-20040304-classless-bgp.patch
+
+inherit autotools eutils flag-o-matic multilib pam readme.gentoo-r1 systemd 
user
+
+DESCRIPTION="A free routing daemon replacing Zebra supporting RIP, OSPF and 
BGP"
+HOMEPAGE="http://quagga.net/;
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz
+   bgpclassless? ( 
http://hasso.linux.ee/stuff/patches/quagga/${CLASSLESS_BGP_PATCH} )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~s390 ~sparc ~x86"
+
+IUSE="bgpclassless caps doc elibc_glibc ipv6 multipath ospfapi pam +readline 
snmp tcp-zebra"
+
+COMMON_DEPEND="
+   caps? ( sys-libs/libcap )
+   snmp? ( net-analyzer/net-snmp )
+   readline? (
+   sys-libs/readline:0
+   pam? ( sys-libs/pam )
+   )
+   !elibc_glibc? ( dev-libs/libpcre )"
+DEPEND="${COMMON_DEPEND}
+   app-arch/xz-utils
+   sys-apps/gawk
+   sys-devel/libtool:2"
+RDEPEND="${COMMON_DEPEND}
+   sys-apps/iproute2"
+
+PATCHES=(
+   "${FILESDIR}/${PN}-0.99.22.4-ipctl-forwarding.patch"
+   "${FILESDIR}/${P}-ripd-null-pointer-fix.patch"
+   "${FILESDIR}/${P}-ospfd-dangling-pointer-fix.patch"
+   "${FILESDIR}/${P}-bgpd-logging-fix.patch"
+)
+
+DISABLE_AUTOFORMATTING=1
+DOC_CONTENTS="Sample configuration files can be found in 
/usr/share/doc/${PF}/samples
+You have to create config files in /etc/quagga before
+starting one of the daemons.
+
+You can pass additional options to the daemon by setting the EXTRA_OPTS
+variable in their respective file in /etc/conf.d"
+
+pkg_setup() {
+   enewgroup quagga
+   enewuser quagga -1 -1 /var/empty quagga
+}
+
+src_prepare() {
+   # Classless prefixes for BGP
+   # http://hasso.linux.ee/doku.php/english:network:quagga
+   use bgpclassless && eapply -p0 "${DISTDIR}/${CLASSLESS_BGP_PATCH}"
+
+   epatch ${PATCHES[@]}
+   eapply_user
+   eautoreconf
+}
+
+src_configure() {
+   append-flags -fno-strict-aliasing
+
+   # do not build PDF docs
+   export ac_cv_prog_PDFLATEX=no
+   export ac_cv_prog_LATEXMK=no
+
+   econf \
+   --enable-exampledir=/usr/share/doc/${PF}/samples \
+   --enable-irdp \
+   --enable-isisd \
+   --enable-isis-topology \
+   --enable-pimd \
+   --enable-user=quagga \
+   --enable-group=quagga \
+   --enable-vty-group=quagga \
+   --with-cflags="${CFLAGS}" \
+   --with-pkg-extra-version="-gentoo" \
+   

[gentoo-commits] repo/gentoo:master commit in: net-misc/quagga/files/, net-misc/quagga/

2016-06-20 Thread Sergey Popov
commit: f7f48f9018359a5a268288fdd4988027f56cef3e
Author: Sergey Popov  gentoo  org>
AuthorDate: Mon Jun 20 20:54:17 2016 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Mon Jun 20 20:54:17 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7f48f90

net-misc/quagga: revision bump

Fix dangling pointer dereference in ospfd,
making it useable again on p2p links
Commited straight to stable

Package-Manager: portage-2.3.0_rc1

 ...a-1.0.20160315-ospfd-dangling-pointer-fix.patch | 134 +
 ...315-r1.ebuild => quagga-1.0.20160315-r2.ebuild} |   3 +-
 2 files changed, 136 insertions(+), 1 deletion(-)

diff --git 
a/net-misc/quagga/files/quagga-1.0.20160315-ospfd-dangling-pointer-fix.patch 
b/net-misc/quagga/files/quagga-1.0.20160315-ospfd-dangling-pointer-fix.patch
new file mode 100644
index 000..cc24fba
--- /dev/null
+++ b/net-misc/quagga/files/quagga-1.0.20160315-ospfd-dangling-pointer-fix.patch
@@ -0,0 +1,134 @@
+From bb01bdd740339b0c07d8ed0786811801b2a79192 Mon Sep 17 00:00:00 2001
+From: Jafar Al-Gharaibeh 
+Date: Thu, 21 Apr 2016 21:22:33 +
+Subject: ospfd: fix - correct neighbor index on changing/p2p/virtual links
+
+ospfd keeps a list of neighbor routers for each configured interface. This
+ list is indexed using the neighbor router id in case of point-to-point and
+ virtual link types, otherwise the list is indexed using the neighbor's
+ source IP (RFC 2328, page 96). The router adds itself as a "pseudo" neighbor
+ on each link, and also keeps a pointer called (nbr_self) to the neighbor
+ structure. This takes place when the interface is first configured. Currently
+ ospfd adds this pseudo neighbor before the link parameters are fully 
configure,
+ including whether the link type is point-to-point or virtual link. This causes
+ the pseudo neighbor to be always indexed using the source IP address 
regardless
+ of th link type. For point-to-point and virtual links, this causes the lookup
+ for the pseudo neighbor to always fail because the lookup is done using the
+ router id whereas the neighbor was added using its source IP address.
+ This becomes really problematic if there is a state change that requires a
+ rebuild of nbr_self, changing the router id for example. When resetting
+ nbr_self, the router first tries to remove the pseudo neighbor form its
+ neighbor list on each link by looking it up and resetting any references to it
+ before freeing the neighbor structure. since the lookup fails to retrieve any
+ references in the case of point-to-point and virtual links the neighbor
+ structure is freed leaving dangling references to it. Any access to the
+ neighbor list after that is bound to stumble over this dangling pointer
+ causing ospfd to crash.
+
+Signed-off-by: Jafar Al-Gharaibeh 
+Tested-by: NetDEF CI System 
+---
+diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
+index f4242b0..d54bc47 100644
+--- a/ospfd/ospf_interface.c
 b/ospfd/ospf_interface.c
+@@ -232,8 +232,8 @@ ospf_if_new (struct ospf *ospf, struct interface *ifp, 
struct prefix *p)
+   /* Set default values. */
+   ospf_if_reset_variables (oi);
+ 
+-  /* Add pseudo neighbor. */
+-  oi->nbr_self = ospf_nbr_new (oi);
++  /* Set pseudo neighbor to Null */
++  oi->nbr_self = NULL;
+ 
+   oi->ls_upd_queue = route_table_init ();
+   oi->t_ls_upd_event = NULL;
+@@ -902,7 +902,9 @@ ospf_vl_new (struct ospf *ospf, struct ospf_vl_data 
*vl_data)
+   if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug ("ospf_vl_new(): set associated area to the backbone");
+ 
+-  ospf_nbr_add_self (voi);
++  /* Add pseudo neighbor. */
++  ospf_nbr_self_reset (voi);
++
+   ospf_area_add_if (voi->area, voi);
+ 
+   ospf_if_stream_set (voi);
+diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
+index 862de5e..06e63dd 100644
+--- a/ospfd/ospf_neighbor.c
 b/ospfd/ospf_neighbor.c
+@@ -181,6 +181,35 @@ ospf_nbr_delete (struct ospf_neighbor *nbr)
+ 
+   route_unlock_node (rn);
+ }
++  else
++{
++  /*
++   * This neighbor was not found, but before we move on and
++   * free the neighbor structre, make sure that it was not
++   * indexed incorrectly and ended up in the "worng" place
++   */
++
++  /* Reverse the lookup rules */
++  if (oi->type == OSPF_IFTYPE_VIRTUALLINK ||
++oi->type == OSPF_IFTYPE_POINTOPOINT)
++  p.u.prefix4 = nbr->src;
++  else
++  p.u.prefix4 = nbr->router_id;
++
++  rn = route_node_lookup (oi->nbrs, );
++  if (rn){
++  /* We found the neighbor!
++   * Now make sure it is not the exact same neighbor
++   * structure that we are about to free
++   */
++  if (nbr == rn->info){
++/* Same neighbor, drop the reference to it */
++rn->info = NULL;
++route_unlock_node (rn);
++  }
++  route_unlock_node (rn);
++  }
++}
+ 
+   /* Free ospf_neighbor structure. */
+   ospf_nbr_free (nbr);
+@@ 

[gentoo-commits] repo/gentoo:master commit in: net-misc/quagga/files/, net-misc/quagga/

2016-04-12 Thread Sergey Popov
commit: ca6d97524c94cc87abce4d9b3281d6e6be646838
Author: Sergey Popov  gentoo  org>
AuthorDate: Tue Apr 12 13:02:00 2016 +
Commit: Sergey Popov  gentoo  org>
CommitDate: Tue Apr 12 13:15:10 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca6d9752

net-misc/quagga: revision bump

Fix NULL pointer dereference in ripd
Commited straight to stable

Reported-by: Sebastian Kricner  tuxwave.net>
Acked-by: Sergey Popov  gentoo.org>
Gentoo-Bug: 579386

Package-Manager: portage-2.2.28
RepoMan-Options: --force

 ...quagga-1.0.20160315-ripd-null-pointer-fix.patch | 40 ++
 ...160315.ebuild => quagga-1.0.20160315-r1.ebuild} |  5 ++-
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git 
a/net-misc/quagga/files/quagga-1.0.20160315-ripd-null-pointer-fix.patch 
b/net-misc/quagga/files/quagga-1.0.20160315-ripd-null-pointer-fix.patch
new file mode 100644
index 000..e48c304
--- /dev/null
+++ b/net-misc/quagga/files/quagga-1.0.20160315-ripd-null-pointer-fix.patch
@@ -0,0 +1,40 @@
+The rip_output_process function dereferenced a NULL
+pointer.  Core file examination showed that tmp_rinfo
+was NULL on line 2435.  Looking at the last diff
+associated with this commit, it was obvious that
+a formating mistake had been made in the loop over
+the route nodes list of possible paths.
+
+Signed-off-by: Donald Sharp 
+Reported-by: Sebastian Kricner 
+---
+ ripd/ripd.c | 14 --
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/ripd/ripd.c b/ripd/ripd.c
+index 82b1ada..0beb0e6 100644
+--- a/ripd/ripd.c
 b/ripd/ripd.c
+@@ -2429,12 +2429,14 @@ rip_output_process (struct connected *ifc, struct 
sockaddr_in *to,
+ struct rip_info *tmp_rinfo = NULL;
+ 
+ for (ALL_LIST_ELEMENTS_RO (list, listnode, tmp_rinfo))
+-  if (tmp_rinfo->type == ZEBRA_ROUTE_RIP  &&
+-  tmp_rinfo->ifindex == ifc->ifp->ifindex)
+-rinfo->metric_out = RIP_METRIC_INFINITY;
+-if (tmp_rinfo->type == ZEBRA_ROUTE_CONNECT &&
+-  prefix_match((struct prefix *)p, ifc->address))
+-  rinfo->metric_out = RIP_METRIC_INFINITY;
++{
++if (tmp_rinfo->type == ZEBRA_ROUTE_RIP  &&
++tmp_rinfo->ifindex == ifc->ifp->ifindex)
++  rinfo->metric_out = RIP_METRIC_INFINITY;
++if (tmp_rinfo->type == ZEBRA_ROUTE_CONNECT &&
++prefix_match((struct prefix *)p, ifc->address))
++  rinfo->metric_out = RIP_METRIC_INFINITY;
++}
+   }
+   
+   /* Prepare preamble, auth headers, if needs be */
+-- 
+1.9.1

diff --git a/net-misc/quagga/quagga-1.0.20160315.ebuild 
b/net-misc/quagga/quagga-1.0.20160315-r1.ebuild
similarity index 96%
rename from net-misc/quagga/quagga-1.0.20160315.ebuild
rename to net-misc/quagga/quagga-1.0.20160315-r1.ebuild
index 949953c..b328a70 100644
--- a/net-misc/quagga/quagga-1.0.20160315.ebuild
+++ b/net-misc/quagga/quagga-1.0.20160315-r1.ebuild
@@ -34,7 +34,10 @@ DEPEND="${COMMON_DEPEND}
 RDEPEND="${COMMON_DEPEND}
sys-apps/iproute2"
 
-PATCHES=( "${FILESDIR}/${PN}-0.99.22.4-ipctl-forwarding.patch" )
+PATCHES=(
+   "${FILESDIR}/${PN}-0.99.22.4-ipctl-forwarding.patch"
+   "${FILESDIR}/${PN}-1.0.20160315-ripd-null-pointer-fix.patch"
+)
 
 DISABLE_AUTOFORMATTING=1
 DOC_CONTENTS="Sample configuration files can be found in 
/usr/share/doc/${PF}/samples