Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: fix false context information for SRv6 route (backport #18023) #18149

Closed
wants to merge 1 commit into from
Closed
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
42 changes: 41 additions & 1 deletion lib/srv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,54 @@ int snprintf_seg6_segs(char *str,
return strlen(str);
}

<<<<<<< HEAD
=======
void seg6local_context2json(const struct seg6local_context *ctx,
uint32_t action, json_object *json)
{
switch (action) {
case ZEBRA_SEG6_LOCAL_ACTION_END:
return;
case ZEBRA_SEG6_LOCAL_ACTION_END_X:
case ZEBRA_SEG6_LOCAL_ACTION_END_DX6:
json_object_string_addf(json, "nh6", "%pI6", &ctx->nh6);
return;
case ZEBRA_SEG6_LOCAL_ACTION_END_DX4:
json_object_string_addf(json, "nh4", "%pI4", &ctx->nh4);
return;
case ZEBRA_SEG6_LOCAL_ACTION_END_T:
case ZEBRA_SEG6_LOCAL_ACTION_END_DT6:
case ZEBRA_SEG6_LOCAL_ACTION_END_DT4:
case ZEBRA_SEG6_LOCAL_ACTION_END_DT46:
json_object_int_add(json, "table", ctx->table);
return;
case ZEBRA_SEG6_LOCAL_ACTION_END_DX2:
json_object_boolean_add(json, "none", true);
return;
case ZEBRA_SEG6_LOCAL_ACTION_END_B6:
case ZEBRA_SEG6_LOCAL_ACTION_END_B6_ENCAP:
json_object_string_addf(json, "nh6", "%pI6", &ctx->nh6);
return;
case ZEBRA_SEG6_LOCAL_ACTION_END_BM:
case ZEBRA_SEG6_LOCAL_ACTION_END_S:
case ZEBRA_SEG6_LOCAL_ACTION_END_AS:
case ZEBRA_SEG6_LOCAL_ACTION_END_AM:
case ZEBRA_SEG6_LOCAL_ACTION_UNSPEC:
default:
json_object_boolean_add(json, "unknown", true);
return;
}
}

>>>>>>> 658bf0281 (lib: fix false context information for SRv6 route)
const char *seg6local_context2str(char *str, size_t size,
const struct seg6local_context *ctx,
uint32_t action)
{
switch (action) {

case ZEBRA_SEG6_LOCAL_ACTION_END:
snprintf(str, size, "USP");
snprintf(str, size, "-");
return str;

case ZEBRA_SEG6_LOCAL_ACTION_END_X:
Expand Down
Loading