@@ -607,10 +607,10 @@ static void bgp_process_nexthop_update(struct bgp_nexthop_cache *bnc,
607
607
}
608
608
609
609
if (nhr -> metric != bnc -> metric )
610
- bnc -> change_flags |= BGP_NEXTHOP_METRIC_CHANGED ;
610
+ SET_FLAG ( bnc -> change_flags , BGP_NEXTHOP_METRIC_CHANGED ) ;
611
611
612
612
if (nhr -> nexthop_num != bnc -> nexthop_num )
613
- bnc -> change_flags |= BGP_NEXTHOP_CHANGED ;
613
+ SET_FLAG ( bnc -> change_flags , BGP_NEXTHOP_CHANGED ) ;
614
614
615
615
if (import_check && (nhr -> type == ZEBRA_ROUTE_BGP ||
616
616
!prefix_same (& bnc -> prefix , & nhr -> prefix ))) {
@@ -636,11 +636,12 @@ static void bgp_process_nexthop_update(struct bgp_nexthop_cache *bnc,
636
636
UNSET_FLAG (bnc -> flags , BGP_NEXTHOP_PEER_NOTIFIED );
637
637
638
638
if (!bnc -> is_evpn_gwip_nexthop )
639
- bnc -> flags |= BGP_NEXTHOP_VALID ;
639
+ SET_FLAG ( bnc -> flags , BGP_NEXTHOP_VALID ) ;
640
640
bnc -> metric = nhr -> metric ;
641
641
bnc -> nexthop_num = nhr -> nexthop_num ;
642
642
643
- bnc -> flags &= ~BGP_NEXTHOP_LABELED_VALID ; /* check below */
643
+ UNSET_FLAG (bnc -> flags ,
644
+ BGP_NEXTHOP_LABELED_VALID ); /* check below */
644
645
645
646
for (i = 0 ; i < nhr -> nexthop_num ; i ++ ) {
646
647
int num_labels = 0 ;
@@ -670,8 +671,7 @@ static void bgp_process_nexthop_update(struct bgp_nexthop_cache *bnc,
670
671
/* There is at least one label-switched path */
671
672
if (nexthop -> nh_label &&
672
673
nexthop -> nh_label -> num_labels ) {
673
-
674
- bnc -> flags |= BGP_NEXTHOP_LABELED_VALID ;
674
+ SET_FLAG (bnc -> flags , BGP_NEXTHOP_LABELED_VALID );
675
675
num_labels = nexthop -> nh_label -> num_labels ;
676
676
}
677
677
@@ -695,15 +695,15 @@ static void bgp_process_nexthop_update(struct bgp_nexthop_cache *bnc,
695
695
* determined
696
696
* that there has been a change.
697
697
*/
698
- if (bnc -> change_flags & BGP_NEXTHOP_CHANGED )
698
+ if (CHECK_FLAG ( bnc -> change_flags , BGP_NEXTHOP_CHANGED ) )
699
699
continue ;
700
700
701
701
for (oldnh = bnc -> nexthop ; oldnh ; oldnh = oldnh -> next )
702
702
if (nexthop_same (oldnh , nexthop ))
703
703
break ;
704
704
705
705
if (!oldnh )
706
- bnc -> change_flags |= BGP_NEXTHOP_CHANGED ;
706
+ SET_FLAG ( bnc -> change_flags , BGP_NEXTHOP_CHANGED ) ;
707
707
}
708
708
bnc_nexthop_free (bnc );
709
709
bnc -> nexthop = nhlist_head ;
@@ -727,19 +727,22 @@ static void bgp_process_nexthop_update(struct bgp_nexthop_cache *bnc,
727
727
: "failed" ));
728
728
729
729
if (evpn_resolved ) {
730
- bnc -> flags |= BGP_NEXTHOP_VALID ;
731
- bnc -> flags &= ~BGP_NEXTHOP_EVPN_INCOMPLETE ;
732
- bnc -> change_flags |= BGP_NEXTHOP_MACIP_CHANGED ;
730
+ SET_FLAG (bnc -> flags , BGP_NEXTHOP_VALID );
731
+ UNSET_FLAG (bnc -> flags ,
732
+ BGP_NEXTHOP_EVPN_INCOMPLETE );
733
+ SET_FLAG (bnc -> change_flags ,
734
+ BGP_NEXTHOP_MACIP_CHANGED );
733
735
} else {
734
- bnc -> flags |= BGP_NEXTHOP_EVPN_INCOMPLETE ;
735
- bnc -> flags &= ~BGP_NEXTHOP_VALID ;
736
+ SET_FLAG (bnc -> flags ,
737
+ BGP_NEXTHOP_EVPN_INCOMPLETE );
738
+ UNSET_FLAG (bnc -> flags , BGP_NEXTHOP_VALID );
736
739
}
737
740
}
738
741
} else {
739
742
memset (& bnc -> resolved_prefix , 0 , sizeof (bnc -> resolved_prefix ));
740
- bnc -> flags &= ~ BGP_NEXTHOP_EVPN_INCOMPLETE ;
741
- bnc -> flags &= ~ BGP_NEXTHOP_VALID ;
742
- bnc -> flags &= ~ BGP_NEXTHOP_LABELED_VALID ;
743
+ UNSET_FLAG ( bnc -> flags , BGP_NEXTHOP_EVPN_INCOMPLETE ) ;
744
+ UNSET_FLAG ( bnc -> flags , BGP_NEXTHOP_VALID ) ;
745
+ UNSET_FLAG ( bnc -> flags , BGP_NEXTHOP_LABELED_VALID ) ;
743
746
bnc -> nexthop_num = nhr -> nexthop_num ;
744
747
745
748
/* notify bgp fsm if nbr ip goes from valid->invalid */
@@ -1181,7 +1184,7 @@ static void sendmsg_zebra_rnh(struct bgp_nexthop_cache *bnc, int command)
1181
1184
static void register_zebra_rnh (struct bgp_nexthop_cache * bnc )
1182
1185
{
1183
1186
/* Check if we have already registered */
1184
- if (bnc -> flags & BGP_NEXTHOP_REGISTERED )
1187
+ if (CHECK_FLAG ( bnc -> flags , BGP_NEXTHOP_REGISTERED ) )
1185
1188
return ;
1186
1189
1187
1190
if (bnc -> ifindex_ipv6_ll ) {
0 commit comments