diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-04-24 12:14:30 +0300 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-04-24 11:04:13 +0000 |
commit | 3325f43afc5a550422140d4234bf1bb58a844b84 (patch) | |
tree | 73f3dd945ff8622738446573c0bb3c9e7d48d71c | |
parent | a5d905b64b686d200dcf25036669622bf9ed67cf (diff) | |
download | aports-3325f43afc5a550422140d4234bf1bb58a844b84.tar.bz2 aports-3325f43afc5a550422140d4234bf1bb58a844b84.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.
(cherry picked from commit ab986e0a47c9ee28c006cd0388eb92ff71724cab)
Conflicts:
main/quagga/APKBUILD
-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 166279bfd6..c13086cdb0 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=2 +pkgrel=3 pkgdesc="A free routing daemon replacing Zebra supporting RIP, OSPF and BGP." url="http://quagga.net/" arch="all" @@ -14,6 +14,7 @@ pkgusers="quagga" pkggroups="quagga" source="http://download.savannah.gnu.org/releases/quagga/quagga-$pkgver.tar.xz quagga-0.99.16-ipctl_forwarding.patch + bgpd-implement-next-hop-self-all.patch bgpd.initd ospf6d.initd ospfd.initd @@ -72,6 +73,7 @@ package() { } md5sums="03ef24a448be47beba80efa2152f8a28 quagga-0.99.22.4.tar.xz 2328ad4066584654cfc73f66d39dc267 quagga-0.99.16-ipctl_forwarding.patch +2e78b3ea20041f94ff99798d37e1456e bgpd-implement-next-hop-self-all.patch ec7ac8cc1103f023cf5b9482b26ece59 bgpd.initd 92aba039c049050c48abf984c2db7e2b ospf6d.initd 878328ead225e6eb5f5f77f05ab39106 ospfd.initd @@ -81,6 +83,7 @@ cda4115283d9f4a8304fec1b6881a7eb ripngd.initd 34e06a1d2bc602ce691abc9ed169dd15 zebra.confd" sha256sums="5e12056692e2dbc272a929f96d0e98d9873f4e7f7ffcca62434b58f6660a6386 quagga-0.99.22.4.tar.xz f06053e2a9030be80992bb7d4b18f4cfecd2d43cb09458557b6b8c1ac3fd22ca quagga-0.99.16-ipctl_forwarding.patch +979ed4f7a3e3b604a2cd3c717df467e253a4b75160f870343e6d96af0c9687ec bgpd-implement-next-hop-self-all.patch 962afa79a0bcb781acc4c367ed55ccea2fbb927cf1271bc1fefaffcbb2f9389a bgpd.initd f1017e7681692d99eab6f9842313be18104612055bcdab14dd7ac4ac1be38f53 ospf6d.initd fed815e6530551f314297704e5491f5d2eeb16e930dcff6f12edc88a78b6023a ospfd.initd @@ -90,6 +93,7 @@ fed815e6530551f314297704e5491f5d2eeb16e930dcff6f12edc88a78b6023a ospfd.initd f7a52d383f60270a5a8fee5d4ac522c5c0ec2b7c4b5252cff54e260f32d9b323 zebra.confd" sha512sums="bcf429e71073e4fc71efc364a21a6c8b70871a17c66bd1328bc57b57962c2c15182436183b2e363c9c1c0e85d84c49d304d4049d40129272f52d6140db330b8a quagga-0.99.22.4.tar.xz 1f4c45765bc1a8678ad1404bfab65799d9329e8f78a897b5c9c294d167745dd10d25304ba490988d9e94ae815c2c6f107b13efb3c710c44515470a61e2dd7c84 quagga-0.99.16-ipctl_forwarding.patch +44677f3852b31f2f2776507b0da004431d12253b5897336d49525114a87945283a21d6dfe6162a73ff1f006fc235e31a753ac591aa70e6b8f4fbb3adb75e00f9 bgpd-implement-next-hop-self-all.patch a865d9f5d2593270abc56dc65785317115337da00e8f389df3bf9af314052a4dc9e8f7af1142f7726637e06f1d8f7640cafd2a9e5ee8a7b4fd6b4e7b7c5bc784 bgpd.initd f76aaacb1949a528a71a4bb69e9b6fa522c507000e8fa0cd60e0d80b8d2820155fa40fe7dedd86bdf38dc8029b1958c90bfbc8423afc737aae59248adba906b3 ospf6d.initd fa3edb10d5b543c3f53a4dbd82edcda011be01f2d94b7b208cc02c1137a33adb703b734e7a4f22a51ec4d66203c44918dc9441be02b67248858b413146c61c16 ospfd.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 + |