prefix2str(&rn->p, buf1, sizeof(buf1));
- json_route = json_object_new_object();
- if (json)
+ if (json) {
+ json_route = json_object_new_object();
json_object_object_add(json, buf1, json_route);
+ }
switch (or->path_type) {
case OSPF_PATH_INTER_AREA:
}
}
}
- if (!json)
- json_object_free(json_route);
}
if (!json)
vty_out(vty, "\n");
continue;
int flag = 0;
- json_route = json_object_new_object();
if (json) {
+ json_route = json_object_new_object();
json_object_object_add(
json, inet_ntop(AF_INET, &rn->p.u.prefix4,
buf, sizeof(buf)),
}
}
}
- if (!json)
- json_object_free(json_route);
}
if (!json)
vty_out(vty, "\n");
char buf1[19];
snprintfrr(buf1, sizeof(buf1), "%pFX", &rn->p);
- json_route = json_object_new_object();
- if (json)
+ if (json) {
+ json_route = json_object_new_object();
json_object_object_add(json, buf1, json_route);
+ }
switch (er->path_type) {
case OSPF_PATH_TYPE1_EXTERNAL:
}
}
}
- if (!json)
- json_object_free(json_route);
}
if (!json)
vty_out(vty, "\n");