bgpd: Fix more assignments inside of if statement

Code inspection showed a bunch more spots where
we were assigning the safi inside of a if statement

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-03-06 10:43:15 -05:00
parent 471e1f1839
commit 666f2cefa1

View File

@ -5267,7 +5267,7 @@ bgp_aggregate_increment (struct bgp *bgp, struct prefix *p,
struct bgp_table *table; struct bgp_table *table;
/* MPLS-VPN aggregation is not yet supported. */ /* MPLS-VPN aggregation is not yet supported. */
if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP) || (safi = SAFI_EVPN)) if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP) || (safi == SAFI_EVPN))
return; return;
table = bgp->aggregate[afi][safi]; table = bgp->aggregate[afi][safi];
@ -5304,7 +5304,7 @@ bgp_aggregate_decrement (struct bgp *bgp, struct prefix *p,
struct bgp_table *table; struct bgp_table *table;
/* MPLS-VPN aggregation is not yet supported. */ /* MPLS-VPN aggregation is not yet supported. */
if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP) || (safi = SAFI_EVPN)) if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP) || (safi == SAFI_EVPN))
return; return;
table = bgp->aggregate[afi][safi]; table = bgp->aggregate[afi][safi];
@ -6129,7 +6129,7 @@ route_vty_out (struct vty *vty, struct prefix *p,
{ {
json_nexthop_global = json_object_new_object(); json_nexthop_global = json_object_new_object();
if ((safi == SAFI_MPLS_VPN) || (safi = SAFI_EVPN)) if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_EVPN))
json_object_string_add(json_nexthop_global, "ip", inet_ntoa (attr->extra->mp_nexthop_global_in)); json_object_string_add(json_nexthop_global, "ip", inet_ntoa (attr->extra->mp_nexthop_global_in));
else else
json_object_string_add(json_nexthop_global, "ip", inet_ntoa (attr->nexthop)); json_object_string_add(json_nexthop_global, "ip", inet_ntoa (attr->nexthop));
@ -6139,7 +6139,7 @@ route_vty_out (struct vty *vty, struct prefix *p,
} }
else else
{ {
if ((safi == SAFI_MPLS_VPN) || (safi = SAFI_EVPN)) if ((safi == SAFI_MPLS_VPN) || (safi == SAFI_EVPN))
vty_out (vty, "%-16s", vty_out (vty, "%-16s",
inet_ntoa (attr->extra->mp_nexthop_global_in)); inet_ntoa (attr->extra->mp_nexthop_global_in));
else else