From 2b559dd6acd6f0dec89ec22093588064570b426a Mon Sep 17 00:00:00 2001 From: Vasilis Tsiligiannis Date: Fri, 13 Jul 2012 16:35:51 +0000 Subject: [PATCH] quagga: Fix vpnv4 soft-reconfiguration crashes SVN-Revision: 32700 --- ...9-bgpd-fix-vpn4-soft-reconfiguration.patch | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 net/quagga/patches/009-bgpd-fix-vpn4-soft-reconfiguration.patch diff --git a/net/quagga/patches/009-bgpd-fix-vpn4-soft-reconfiguration.patch b/net/quagga/patches/009-bgpd-fix-vpn4-soft-reconfiguration.patch new file mode 100644 index 000000000..4a9cac0f8 --- /dev/null +++ b/net/quagga/patches/009-bgpd-fix-vpn4-soft-reconfiguration.patch @@ -0,0 +1,91 @@ +Index: quagga-0.99.21/bgpd/bgp_route.c +=================================================================== +--- quagga-0.99.21.orig/bgpd/bgp_route.c ++++ quagga-0.99.21/bgpd/bgp_route.c +@@ -2616,7 +2616,7 @@ bgp_announce_route_all (struct peer *pee + + static void + bgp_soft_reconfig_table_rsclient (struct peer *rsclient, afi_t afi, +- safi_t safi, struct bgp_table *table) ++ safi_t safi, struct bgp_table *table, struct prefix_rd *prd) + { + struct bgp_node *rn; + struct bgp_adj_in *ain; +@@ -2627,8 +2627,11 @@ bgp_soft_reconfig_table_rsclient (struct + for (rn = bgp_table_top (table); rn; rn = bgp_route_next (rn)) + for (ain = rn->adj_in; ain; ain = ain->next) + { ++ struct bgp_info *ri = rn->info; ++ + bgp_update_rsclient (rsclient, afi, safi, ain->attr, ain->peer, +- &rn->p, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL, NULL); ++ &rn->p, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, prd, ++ (bgp_info_extra_get (ri))->tag); + } + } + +@@ -2639,18 +2642,25 @@ bgp_soft_reconfig_rsclient (struct peer + struct bgp_node *rn; + + if (safi != SAFI_MPLS_VPN) +- bgp_soft_reconfig_table_rsclient (rsclient, afi, safi, NULL); ++ bgp_soft_reconfig_table_rsclient (rsclient, afi, safi, NULL, NULL); + + else + for (rn = bgp_table_top (rsclient->bgp->rib[afi][safi]); rn; + rn = bgp_route_next (rn)) + if ((table = rn->info) != NULL) +- bgp_soft_reconfig_table_rsclient (rsclient, afi, safi, table); ++ { ++ struct prefix_rd prd; ++ prd.family = AF_UNSPEC; ++ prd.prefixlen = 64; ++ memcpy(&prd.val, rn->p.u.val, 8); ++ ++ bgp_soft_reconfig_table_rsclient (rsclient, afi, safi, table, &prd); ++ } + } + + static void + bgp_soft_reconfig_table (struct peer *peer, afi_t afi, safi_t safi, +- struct bgp_table *table) ++ struct bgp_table *table, struct prefix_rd *prd) + { + int ret; + struct bgp_node *rn; +@@ -2664,9 +2674,12 @@ bgp_soft_reconfig_table (struct peer *pe + { + if (ain->peer == peer) + { ++ struct bgp_info *ri = rn->info; ++ + ret = bgp_update (peer, &rn->p, ain->attr, afi, safi, + ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, +- NULL, NULL, 1); ++ prd, (bgp_info_extra_get (ri))->tag, 1); ++ + if (ret < 0) + { + bgp_unlock_node (rn); +@@ -2687,12 +2700,19 @@ bgp_soft_reconfig_in (struct peer *peer, + return; + + if (safi != SAFI_MPLS_VPN) +- bgp_soft_reconfig_table (peer, afi, safi, NULL); ++ bgp_soft_reconfig_table (peer, afi, safi, NULL, NULL); + else + for (rn = bgp_table_top (peer->bgp->rib[afi][safi]); rn; + rn = bgp_route_next (rn)) + if ((table = rn->info) != NULL) +- bgp_soft_reconfig_table (peer, afi, safi, table); ++ { ++ struct prefix_rd prd; ++ prd.family = AF_UNSPEC; ++ prd.prefixlen = 64; ++ memcpy(&prd.val, rn->p.u.val, 8); ++ ++ bgp_soft_reconfig_table (peer, afi, safi, table, &prd); ++ } + } + + -- 2.30.2