@@ -256,19 +256,8 @@ void gen_bfd_key(struct bfd_key *key, struct sockaddr_any *peer,
256
256
257
257
struct bfd_session * bs_peer_find (struct bfd_peer_cfg * bpc )
258
258
{
259
- struct bfd_session * bs ;
260
- struct peer_label * pl ;
261
259
struct bfd_key key ;
262
260
263
- /* Try to find label first. */
264
- if (bpc -> bpc_has_label ) {
265
- pl = pl_find (bpc -> bpc_label );
266
- if (pl != NULL ) {
267
- bs = pl -> pl_bs ;
268
- return bs ;
269
- }
270
- }
271
-
272
261
/* Otherwise fallback to peer/local hash lookup. */
273
262
gen_bfd_key (& key , & bpc -> bpc_peer , & bpc -> bpc_local , bpc -> bpc_mhop ,
274
263
bpc -> bpc_localif , bpc -> bpc_vrfname );
@@ -327,10 +316,8 @@ int bfd_session_enable(struct bfd_session *bs)
327
316
bs -> ifp = ifp ;
328
317
329
318
/* Attempt to use data plane. */
330
- if (bglobal .bg_use_dplane && bfd_dplane_add_session (bs ) == 0 ) {
331
- control_notify_config (BCM_NOTIFY_CONFIG_ADD , bs );
319
+ if (bglobal .bg_use_dplane && bfd_dplane_add_session (bs ) == 0 )
332
320
return 0 ;
333
- }
334
321
335
322
/* Sanity check: don't leak open sockets. */
336
323
if (bs -> sock != -1 ) {
@@ -502,7 +489,7 @@ void ptm_bfd_sess_up(struct bfd_session *bfd)
502
489
/* Start sending control packets with poll bit immediately. */
503
490
ptm_bfd_snd (bfd , 0 );
504
491
505
- control_notify (bfd , bfd -> ses_state );
492
+ ptm_bfd_notify (bfd , bfd -> ses_state );
506
493
507
494
if (old_state != bfd -> ses_state ) {
508
495
bfd -> stats .session_up ++ ;
@@ -538,7 +525,7 @@ void ptm_bfd_sess_dn(struct bfd_session *bfd, uint8_t diag)
538
525
539
526
/* only signal clients when going from up->down state */
540
527
if (old_state == PTM_BFD_UP )
541
- control_notify (bfd , PTM_BFD_DOWN );
528
+ ptm_bfd_notify (bfd , PTM_BFD_DOWN );
542
529
543
530
/* Stop echo packet transmission if they are active */
544
531
if (CHECK_FLAG (bfd -> flags , BFD_SESS_FLAG_ECHO_ACTIVE ))
@@ -690,38 +677,6 @@ struct bfd_session *bfd_session_new(void)
690
677
return bs ;
691
678
}
692
679
693
- int bfd_session_update_label (struct bfd_session * bs , const char * nlabel )
694
- {
695
- /* New label treatment:
696
- * - Check if the label is taken;
697
- * - Try to allocate the memory for it and register;
698
- */
699
- if (bs -> pl == NULL ) {
700
- if (pl_find (nlabel ) != NULL ) {
701
- /* Someone is already using it. */
702
- return -1 ;
703
- }
704
-
705
- pl_new (nlabel , bs );
706
-
707
- return 0 ;
708
- }
709
-
710
- /*
711
- * Test label change consistency:
712
- * - Do nothing if it's the same label;
713
- * - Check if the future label is already taken;
714
- * - Change label;
715
- */
716
- if (strcmp (nlabel , bs -> pl -> pl_label ) == 0 )
717
- return -1 ;
718
- if (pl_find (nlabel ) != NULL )
719
- return -1 ;
720
-
721
- strlcpy (bs -> pl -> pl_label , nlabel , sizeof (bs -> pl -> pl_label ));
722
- return 0 ;
723
- }
724
-
725
680
static void _bfd_session_update (struct bfd_session * bs ,
726
681
struct bfd_peer_cfg * bpc )
727
682
{
@@ -750,9 +705,6 @@ static void _bfd_session_update(struct bfd_session *bs,
750
705
bs -> peer_profile .min_echo_tx = bs -> timers .desired_min_echo_tx ;
751
706
}
752
707
753
- if (bpc -> bpc_has_label )
754
- bfd_session_update_label (bs , bpc -> bpc_label );
755
-
756
708
if (bpc -> bpc_cbit )
757
709
SET_FLAG (bs -> flags , BFD_SESS_FLAG_CBIT );
758
710
else
@@ -792,8 +744,6 @@ static int bfd_session_update(struct bfd_session *bs, struct bfd_peer_cfg *bpc)
792
744
793
745
_bfd_session_update (bs , bpc );
794
746
795
- control_notify_config (BCM_NOTIFY_CONFIG_UPDATE , bs );
796
-
797
747
return 0 ;
798
748
}
799
749
@@ -819,8 +769,6 @@ void bfd_session_free(struct bfd_session *bs)
819
769
if (bso != NULL )
820
770
bs_observer_del (bso );
821
771
822
- pl_free (bs -> pl );
823
-
824
772
XFREE (MTYPE_BFDD_PROFILE , bs -> profile_name );
825
773
XFREE (MTYPE_BFDD_CONFIG , bs );
826
774
}
@@ -917,8 +865,6 @@ struct bfd_session *bs_registrate(struct bfd_session *bfd)
917
865
if (bglobal .debug_peer_event )
918
866
zlog_debug ("session-new: %s" , bs_to_string (bfd ));
919
867
920
- control_notify_config (BCM_NOTIFY_CONFIG_ADD , bfd );
921
-
922
868
return bfd ;
923
869
}
924
870
@@ -941,8 +887,6 @@ int ptm_bfd_sess_del(struct bfd_peer_cfg *bpc)
941
887
if (bglobal .debug_peer_event )
942
888
zlog_debug ("%s: %s" , __func__ , bs_to_string (bs ));
943
889
944
- control_notify_config (BCM_NOTIFY_CONFIG_DELETE , bs );
945
-
946
890
bfd_session_free (bs );
947
891
948
892
return 0 ;
@@ -1166,11 +1110,8 @@ void bs_final_handler(struct bfd_session *bs)
1166
1110
* When using demand mode we must disable the detection timer
1167
1111
* for lost control packets.
1168
1112
*/
1169
- if (bs -> demand_mode ) {
1170
- /* Notify watchers about changed timers. */
1171
- control_notify_config (BCM_NOTIFY_CONFIG_UPDATE , bs );
1113
+ if (bs -> demand_mode )
1172
1114
return ;
1173
- }
1174
1115
1175
1116
/*
1176
1117
* Calculate transmission time based on new timers.
@@ -1189,9 +1130,6 @@ void bs_final_handler(struct bfd_session *bs)
1189
1130
1190
1131
/* Apply new transmission timer immediately. */
1191
1132
ptm_bfd_start_xmt_timer (bs , false);
1192
-
1193
- /* Notify watchers about changed timers. */
1194
- control_notify_config (BCM_NOTIFY_CONFIG_UPDATE , bs );
1195
1133
}
1196
1134
1197
1135
void bs_set_slow_timers (struct bfd_session * bs )
@@ -1261,7 +1199,7 @@ void bfd_set_shutdown(struct bfd_session *bs, bool shutdown)
1261
1199
if (bs -> bdc ) {
1262
1200
bs -> ses_state = PTM_BFD_ADM_DOWN ;
1263
1201
bfd_dplane_update_session (bs );
1264
- control_notify (bs , bs -> ses_state );
1202
+ ptm_bfd_notify (bs , bs -> ses_state );
1265
1203
return ;
1266
1204
}
1267
1205
@@ -1273,7 +1211,7 @@ void bfd_set_shutdown(struct bfd_session *bs, bool shutdown)
1273
1211
1274
1212
/* Change and notify state change. */
1275
1213
bs -> ses_state = PTM_BFD_ADM_DOWN ;
1276
- control_notify (bs , bs -> ses_state );
1214
+ ptm_bfd_notify (bs , bs -> ses_state );
1277
1215
1278
1216
/* Don't try to send packets with a disabled session. */
1279
1217
if (bs -> sock != -1 )
@@ -1289,13 +1227,13 @@ void bfd_set_shutdown(struct bfd_session *bs, bool shutdown)
1289
1227
if (bs -> bdc ) {
1290
1228
bs -> ses_state = PTM_BFD_DOWN ;
1291
1229
bfd_dplane_update_session (bs );
1292
- control_notify (bs , bs -> ses_state );
1230
+ ptm_bfd_notify (bs , bs -> ses_state );
1293
1231
return ;
1294
1232
}
1295
1233
1296
1234
/* Change and notify state change. */
1297
1235
bs -> ses_state = PTM_BFD_DOWN ;
1298
- control_notify (bs , bs -> ses_state );
1236
+ ptm_bfd_notify (bs , bs -> ses_state );
1299
1237
1300
1238
/* Enable timers if non passive, otherwise stop them. */
1301
1239
if (CHECK_FLAG (bs -> flags , BFD_SESS_FLAG_PASSIVE )) {
0 commit comments