Skip to content

Commit

Permalink
bgpd: fix crash in soft-reconfiguration
Browse files Browse the repository at this point in the history
Commit 8692c50 introduced a bug where bgpd would crash on
soft-reconfiguration.

This happens e.g. when there are filtered unicast routes because
rn->info is NULL in that case, which the code did not account for.

Reported-by: Paweł Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
  • Loading branch information
cfra authored and eqvinox committed Feb 1, 2013
1 parent aeef13b commit d53d8fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,10 +2643,10 @@ bgp_soft_reconfig_table_rsclient (struct peer *rsclient, afi_t afi,
for (ain = rn->adj_in; ain; ain = ain->next)
{
struct bgp_info *ri = rn->info;
u_char *tag = (ri && ri->extra) ? ri->extra->tag : NULL;

bgp_update_rsclient (rsclient, afi, safi, ain->attr, ain->peer,
&rn->p, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, prd,
(bgp_info_extra_get (ri))->tag);
&rn->p, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, prd, tag);
}
}

Expand Down Expand Up @@ -2690,10 +2690,11 @@ bgp_soft_reconfig_table (struct peer *peer, afi_t afi, safi_t safi,
if (ain->peer == peer)
{
struct bgp_info *ri = rn->info;
u_char *tag = (ri && ri->extra) ? ri->extra->tag : NULL;

ret = bgp_update (peer, &rn->p, ain->attr, afi, safi,
ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
prd, (bgp_info_extra_get (ri))->tag, 1);
prd, tag, 1);

if (ret < 0)
{
Expand Down

0 comments on commit d53d8fd

Please sign in to comment.