Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meta/gensairpc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ sub generate_server_template_from_skeleton {

# Define global variable before "class"
print {$server_template}
"\nextern sai_object_id_t switch_id;\nsai_object_id_t switch_id;\n\n\n";
"\nextern sai_object_id_t switch_id;\nsai_object_id_t switch_id;\nextern sai_object_id_t gSwitchId;\n\n\n";

# Define helper functions
print {$server_template} "[% PROCESS helper_functions %]\n\n\n";
Expand Down
6 changes: 6 additions & 0 deletions meta/templates/sai_rpc_server_functions.tt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
if (switch_id != NULL) {
return switch_id;
}

//check if the switch created in syncd
if (gSwitchId != NULL) {
switch_id = gSwitchId;
return switch_id;
}

[%- END -%]

Expand Down