@@ -901,6 +901,10 @@ ind_cxn_send_role_status(connection_t *cxn, int reason)
901
901
/* Master -> slave is currently the only possible case */
902
902
INDIGO_ASSERT (cxn -> controller -> role == INDIGO_CXN_R_SLAVE );
903
903
904
+ /* The BSN backport and the standard message use the same reason values */
905
+ AIM_ASSERT (reason == OFPCRR_MASTER_REQUEST );
906
+ AIM_ASSERT (OFPCRR_MASTER_REQUEST == OFP_BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST );
907
+
904
908
if (cxn -> status .negotiated_version == OF_VERSION_1_3 ) {
905
909
of_bsn_role_status_t * msg = of_bsn_role_status_new (OF_VERSION_1_3 );
906
910
if (msg == NULL ) {
@@ -910,6 +914,15 @@ ind_cxn_send_role_status(connection_t *cxn, int reason)
910
914
of_bsn_role_status_reason_set (msg , reason );
911
915
of_bsn_role_status_generation_id_set (msg , ind_cxn_generation_id );
912
916
indigo_cxn_send_controller_message (cxn -> cxn_id , msg );
917
+ } else if (cxn -> status .negotiated_version >= OF_VERSION_1_4 ) {
918
+ of_role_status_t * msg = of_role_status_new (cxn -> status .negotiated_version );
919
+ if (msg == NULL ) {
920
+ AIM_DIE ("Failed to allocate role status message" );
921
+ }
922
+ of_role_status_role_set (msg , OF_CONTROLLER_ROLE_SLAVE );
923
+ of_role_status_reason_set (msg , reason );
924
+ of_role_status_generation_id_set (msg , ind_cxn_generation_id );
925
+ indigo_cxn_send_controller_message (cxn -> cxn_id , msg );
913
926
}
914
927
}
915
928
@@ -937,7 +950,7 @@ ind_controller_change_master(indigo_controller_id_t master_id)
937
950
ctrl -> role = INDIGO_CXN_R_SLAVE ;
938
951
ind_cxn_send_role_status (
939
952
CXN_ID_TO_CONNECTION (ctrl -> aux_id_to_cxn_id [0 ]),
940
- OFP_BSN_CONTROLLER_ROLE_REASON_MASTER_REQUEST );
953
+ OFPCRR_MASTER_REQUEST );
941
954
}
942
955
}
943
956
}
0 commit comments