diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-04-24 12:14:30 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2014-04-24 12:15:58 +0300 |
commit | ab986e0a47c9ee28c006cd0388eb92ff71724cab (patch) | |
tree | cf9fea2e441ae99e78ddddbc5af19498b2b7d1c4 /main | |
parent | 3370b8ac909fa744b11faf4a424e78ae54014405 (diff) | |
download | aports-ab986e0a47c9ee28c006cd0388eb92ff71724cab.tar.bz2 aports-ab986e0a47c9ee28c006cd0388eb92ff71724cab.tar.xz |
main/quagga: apply patch to implement bgp next-hop-self all
Useful in various situations. And practically counts as a bugfix
because the route-map set ip next-hop does not work for iBGP but
it should.
Diffstat (limited to 'main')
-rw-r--r-- | main/quagga/APKBUILD | 6 | ||||
-rw-r--r-- | main/quagga/bgpd-implement-next-hop-self-all.patch | 136 |
2 files changed, 141 insertions, 1 deletions
diff --git a/main/quagga/APKBUILD b/main/quagga/APKBUILD index 34a1309601..6b9f64a25d 100644 --- a/main/quagga/APKBUILD +++ b/main/quagga/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=quagga pkgver=0.99.22.4 -pkgrel=4 +pkgrel=5 pkgdesc="A free routing daemon replacing Zebra supporting RIP, OSPF and BGP." url="http://quagga.net/" arch="all" @@ -13,6 +13,7 @@ subpackages="$pkgname-dev $pkgname-doc" pkgusers="quagga" pkggroups="quagga" source="http://download.savannah.gnu.org/releases/quagga/quagga-$pkgver.tar.xz + bgpd-implement-next-hop-self-all.patch musl-fix-headers.patch quagga-readline-6.3.patch bgpd.initd @@ -72,18 +73,21 @@ package() { install -o quagga -g quagga -d -m755 "$pkgdir"/etc/quagga } md5sums="03ef24a448be47beba80efa2152f8a28 quagga-0.99.22.4.tar.xz +2e78b3ea20041f94ff99798d37e1456e bgpd-implement-next-hop-self-all.patch 27812f0aaaf8507c4338371aca1bd08d musl-fix-headers.patch 46e4020d7f3e1e8790f4b6e0592481b4 quagga-readline-6.3.patch e80a3df594eba8b09e19aa28d9283698 bgpd.initd 33d0e34f11460881161ab930d3d3b987 zebra.initd 34e06a1d2bc602ce691abc9ed169dd15 zebra.confd" sha256sums="5e12056692e2dbc272a929f96d0e98d9873f4e7f7ffcca62434b58f6660a6386 quagga-0.99.22.4.tar.xz +979ed4f7a3e3b604a2cd3c717df467e253a4b75160f870343e6d96af0c9687ec bgpd-implement-next-hop-self-all.patch 19068f58f034891c07b8a1324d0645e0f078e3dc98d1360d51c677cecaae8c9e musl-fix-headers.patch 40264c6f00afc45a88ac1dd488081abf8fdf8864b70e7a7ab2db55dc3e388cda quagga-readline-6.3.patch 41471bfda120cb57bc0f40e87ec23a4f150d2b97c97ececdda6c408eab7cf9a3 bgpd.initd d6cc9280df63859ba711ad2071b38b9ce317d718c34840a2b101debef3fa7b56 zebra.initd f7a52d383f60270a5a8fee5d4ac522c5c0ec2b7c4b5252cff54e260f32d9b323 zebra.confd" sha512sums="bcf429e71073e4fc71efc364a21a6c8b70871a17c66bd1328bc57b57962c2c15182436183b2e363c9c1c0e85d84c49d304d4049d40129272f52d6140db330b8a quagga-0.99.22.4.tar.xz +44677f3852b31f2f2776507b0da004431d12253b5897336d49525114a87945283a21d6dfe6162a73ff1f006fc235e31a753ac591aa70e6b8f4fbb3adb75e00f9 bgpd-implement-next-hop-self-all.patch 28a1695bd77991790df3b1b5a2c8ced929e6413e9acb87c4a8286569d05b20e65cba466e118fc16a11c264ba11dd1581e4143031ce3bbb478177e900ea68cb07 musl-fix-headers.patch db69f04b7894871cb0a6ca2722a99ea2cf42e8a8c88af07b29034d9a1093fb1954767874226df1753c0c8f900e3fe2870f408167a48e7884a1f4c1fb961232f2 quagga-readline-6.3.patch d2bf7e8f2da49d0b039e72e76a77860b5b49d41a80550d6dc84791bbdec1d52e579393c5d42b45aa615991742421fef53ec1b92a5e740779b6060e20f5dd0413 bgpd.initd diff --git a/main/quagga/bgpd-implement-next-hop-self-all.patch b/main/quagga/bgpd-implement-next-hop-self-all.patch new file mode 100644 index 0000000000..d8efde4980 --- /dev/null +++ b/main/quagga/bgpd-implement-next-hop-self-all.patch @@ -0,0 +1,136 @@ +From a672a1b8cacc0353d08770763461bc2a38cfa2cc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> +Date: Thu, 24 Apr 2014 10:22:37 +0300 +Subject: [PATCH v2] bgpd: implement "next-hop-self all" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +As specified in: +http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_bgp/command/irg-cr-book/bgp-m1.html#wp4972925610 + +This allows overriding next-hop for ibgp learned routes on an +RR for reflected routes. + +Especially useful for using iBGP in DMVPN setups. See: +http://blog.ipspace.net/2014/04/changes-in-ibgp-next-hop-processing.html + +Signed-off-by: Timo Teräs <timo.teras@iki.fi> +--- +Update to work have similar semantics as Cisco. The 'no' prefixed forms all cancel +any active next-hop-self. And the regular form can be updated to change the form +that is active. + +Also some stylistic improvements done. + + bgpd/bgp_route.c | 3 ++- + bgpd/bgp_vty.c | 30 +++++++++++++++++++++++------- + bgpd/bgpd.c | 5 ++++- + bgpd/bgpd.h | 1 + + 4 files changed, 30 insertions(+), 9 deletions(-) + +diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c +index 335543e..e0ecd36 100644 +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -962,7 +962,8 @@ bgp_announce_check (struct bgp_info *ri, struct peer *peer, struct prefix *p, + } + + /* next-hop-set */ +- if (transparent || reflect ++ if (transparent ++ || (reflect && ! CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_SELF_ALL)) + || (CHECK_FLAG (peer->af_flags[afi][safi], PEER_FLAG_NEXTHOP_UNCHANGED) + && ((p->family == AF_INET && attr->nexthop.s_addr) + #ifdef HAVE_IPV6 +diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c +index 0f28894..fcbe8e4 100644 +--- a/bgpd/bgp_vty.c ++++ b/bgpd/bgp_vty.c +@@ -2061,25 +2061,41 @@ DEFUN (no_neighbor_capability_orf_prefix, + /* neighbor next-hop-self. */ + DEFUN (neighbor_nexthop_self, + neighbor_nexthop_self_cmd, +- NEIGHBOR_CMD2 "next-hop-self", ++ NEIGHBOR_CMD2 "next-hop-self {all}", + NEIGHBOR_STR + NEIGHBOR_ADDR_STR2 +- "Disable the next hop calculation for this neighbor\n") ++ "Disable the next hop calculation for this neighbor\n" ++ "Apply also to ibgp-learned routes when acting as a route reflector\n") + { +- return peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), +- bgp_node_safi (vty), PEER_FLAG_NEXTHOP_SELF); ++ u_int32_t flags = PEER_FLAG_NEXTHOP_SELF, unset = 0; ++ int rc; ++ ++ /* Check if "all" is specified */ ++ if (argv[1] != NULL) ++ flags |= PEER_FLAG_NEXTHOP_SELF_ALL; ++ else ++ unset |= PEER_FLAG_NEXTHOP_SELF_ALL; ++ ++ rc = peer_af_flag_set_vty (vty, argv[0], bgp_node_afi (vty), ++ bgp_node_safi (vty), flags); ++ if ( rc == CMD_SUCCESS && unset ) ++ rc = peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), ++ bgp_node_safi (vty), unset); ++ return rc; + } + + DEFUN (no_neighbor_nexthop_self, + no_neighbor_nexthop_self_cmd, +- NO_NEIGHBOR_CMD2 "next-hop-self", ++ NO_NEIGHBOR_CMD2 "next-hop-self {all}", + NO_STR + NEIGHBOR_STR + NEIGHBOR_ADDR_STR2 +- "Disable the next hop calculation for this neighbor\n") ++ "Disable the next hop calculation for this neighbor\n" ++ "Apply also to ibgp-learned routes when acting as a route reflector\n") + { + return peer_af_flag_unset_vty (vty, argv[0], bgp_node_afi (vty), +- bgp_node_safi (vty), PEER_FLAG_NEXTHOP_SELF); ++ bgp_node_safi (vty), ++ PEER_FLAG_NEXTHOP_SELF|PEER_FLAG_NEXTHOP_SELF_ALL); + } + + /* neighbor remove-private-AS. */ +diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c +index c9a04ff..fbc40df 100644 +--- a/bgpd/bgpd.c ++++ b/bgpd/bgpd.c +@@ -2331,6 +2331,7 @@ static const struct peer_flag_action peer_af_flag_action_list[] = + { PEER_FLAG_ORF_PREFIX_SM, 1, peer_change_reset }, + { PEER_FLAG_ORF_PREFIX_RM, 1, peer_change_reset }, + { PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED, 0, peer_change_reset_out }, ++ { PEER_FLAG_NEXTHOP_SELF_ALL, 1, peer_change_reset_out }, + { 0, 0, 0 } + }; + +@@ -4965,7 +4966,9 @@ bgp_config_write_peer (struct vty *vty, struct bgp *bgp, + /* Nexthop self. */ + if (peer_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_SELF) + && ! peer->af_group[afi][safi]) +- vty_out (vty, " neighbor %s next-hop-self%s", addr, VTY_NEWLINE); ++ vty_out (vty, " neighbor %s next-hop-self%s%s", addr, ++ peer_af_flag_check (peer, afi, safi, PEER_FLAG_NEXTHOP_SELF_ALL) ? ++ " all" : "", VTY_NEWLINE); + + /* Remove private AS. */ + if (peer_af_flag_check (peer, afi, safi, PEER_FLAG_REMOVE_PRIVATE_AS) +diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h +index 0746f0d..1e41c00 100644 +--- a/bgpd/bgpd.h ++++ b/bgpd/bgpd.h +@@ -405,6 +405,7 @@ struct peer + #define PEER_FLAG_MAX_PREFIX (1 << 14) /* maximum prefix */ + #define PEER_FLAG_MAX_PREFIX_WARNING (1 << 15) /* maximum prefix warning-only */ + #define PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED (1 << 16) /* leave link-local nexthop unchanged */ ++#define PEER_FLAG_NEXTHOP_SELF_ALL (1 << 17) /* next-hop-self all */ + + /* MD5 password */ + char *password; +-- +1.9.2 + |