Skip to content

Commit

Permalink
Convert pointer to bool correctly
Browse files Browse the repository at this point in the history
Also remove default in the switch and cover all cases explicitly

Change-Id: I0fdb4d440bb4067a35519ea2af1cd75cc52ec242
Partial-Bug: #1602347
  • Loading branch information
ananth-at-camphor-networks committed Oct 11, 2016
1 parent 0f12c85 commit 88369ba
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/bgp/ermvpn/ermvpn_route.cc
Expand Up @@ -277,15 +277,12 @@ bool ErmVpnRoute::IsValid() const {
const BgpAttr *attr = BestPath()->GetAttr();
switch (prefix_.type()) {
case ErmVpnPrefix::NativeRoute:
return attr->label_block();
break;
return attr->label_block().get() != NULL;
case ErmVpnPrefix::LocalTreeRoute:
return attr->edge_discovery();
break;
return attr->edge_discovery() != NULL;
case ErmVpnPrefix::GlobalTreeRoute:
return attr->edge_forwarding();
break;
default:
return attr->edge_forwarding() != NULL;
case ErmVpnPrefix::Invalid:
break;
}

Expand Down

0 comments on commit 88369ba

Please sign in to comment.