diff options
author | Hiroki Shirokura <slank.dev@gmail.com> | 2021-02-24 11:47:05 +0100 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2021-06-02 16:24:48 +0200 |
commit | 4df9d8592b1631e6cb50e291cab1ff7486467a3d (patch) | |
tree | b9a5a34549e37434b4be3c9657ab55b17b21d095 /sharpd | |
parent | topotests: for zapi's seg6 route configuration (step3) (diff) | |
download | frr-4df9d8592b1631e6cb50e291cab1ff7486467a3d.tar.xz frr-4df9d8592b1631e6cb50e291cab1ff7486467a3d.zip |
*: fix code format accourding to checkpatch
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Diffstat (limited to 'sharpd')
-rw-r--r-- | sharpd/sharp_vty.c | 4 | ||||
-rw-r--r-- | sharpd/sharp_zebra.c | 19 | ||||
-rw-r--r-- | sharpd/sharp_zebra.h | 6 |
3 files changed, 19 insertions, 10 deletions
diff --git a/sharpd/sharp_vty.c b/sharpd/sharp_vty.c index 5997e5e31..58f6e3fe9 100644 --- a/sharpd/sharp_vty.c +++ b/sharpd/sharp_vty.c @@ -318,6 +318,7 @@ DEFPY (install_routes, } else if (seg6l_oif) { struct seg6local_context ctx; enum seg6local_action_t action; + memset(&ctx, 0, sizeof(struct seg6local_context)); if (seg6l_enddx4) { action = ZEBRA_SEG6_LOCAL_ACTION_END_DX4; @@ -1047,7 +1048,8 @@ void sharp_vty_init(void) install_element(ENABLE_NODE, &show_sharp_ted_cmd); install_element(ENABLE_NODE, &sharp_srv6_manager_get_locator_chunk_cmd); - install_element(ENABLE_NODE, &sharp_srv6_manager_release_locator_chunk_cmd); + install_element(ENABLE_NODE, + &sharp_srv6_manager_release_locator_chunk_cmd); install_element(ENABLE_NODE, &show_sharp_segment_routing_srv6_cmd); return; diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index 7c24ae380..ae4add6a6 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -338,7 +338,8 @@ static void sharp_install_routes_restart(struct prefix *p, uint32_t count, uint32_t nhgid, const struct nexthop_group *nhg, const struct nexthop_group *backup_nhg, - uint32_t routes, uint32_t flags, char *opaque) + uint32_t routes, uint32_t flags, + char *opaque) { uint32_t temp, i; bool v4 = false; @@ -924,7 +925,7 @@ static int nhg_notify_owner(ZAPI_CALLBACK_ARGS) return 0; } -int sharp_zebra_srv6_manager_get_locator_chunk(const char* locator_name) +int sharp_zebra_srv6_manager_get_locator_chunk(const char *locator_name) { return srv6_manager_get_locator_chunk(zclient, locator_name); } @@ -942,6 +943,7 @@ static void sharp_zebra_process_srv6_locator_chunk(ZAPI_CALLBACK_ARGS) uint16_t len; char name[256] = {0}; struct prefix_ipv6 *chunk = NULL; + chunk = prefix_ipv6_new(); s = zclient->ibuf; @@ -965,16 +967,17 @@ static void sharp_zebra_process_srv6_locator_chunk(ZAPI_CALLBACK_ARGS) struct listnode *loc_node; struct sharp_srv6_locator *loc; + for (ALL_LIST_ELEMENTS_RO(sg.srv6_locators, loc_node, loc)) { + struct listnode *chunk_node; + struct prefix_ipv6 *c; + if (strcmp(loc->name, name)) continue; - struct listnode *chunk_node; - struct prefix_ipv6 *c; - for (ALL_LIST_ELEMENTS_RO(loc->chunks, chunk_node, c)) { + for (ALL_LIST_ELEMENTS_RO(loc->chunks, chunk_node, c)) if (!prefix_cmp(c, chunk)) return; - } listnode_add(loc->chunks, chunk); } return; @@ -983,7 +986,6 @@ stream_failure: free(chunk); zlog_err("%s: can't get locator_chunk!!", __func__); - return; } void sharp_zebra_init(void) @@ -1007,5 +1009,6 @@ void sharp_zebra_init(void) zclient->redistribute_route_add = sharp_redistribute_route; zclient->redistribute_route_del = sharp_redistribute_route; zclient->opaque_msg_handler = sharp_opaque_handler; - zclient->process_srv6_locator_chunk = sharp_zebra_process_srv6_locator_chunk; + zclient->process_srv6_locator_chunk = + sharp_zebra_process_srv6_locator_chunk; } diff --git a/sharpd/sharp_zebra.h b/sharpd/sharp_zebra.h index 043a7405c..45e26a9b3 100644 --- a/sharpd/sharp_zebra.h +++ b/sharpd/sharp_zebra.h @@ -39,7 +39,8 @@ extern void sharp_install_routes_helper(struct prefix *p, vrf_id_t vrf_id, uint8_t instance, uint32_t nhgid, const struct nexthop_group *nhg, const struct nexthop_group *backup_nhg, - uint32_t routes, uint32_t flags, char *opaque); + uint32_t routes, uint32_t flags, + char *opaque); extern void sharp_remove_routes_helper(struct prefix *p, vrf_id_t vrf_id, uint8_t instance, uint32_t routes); @@ -67,6 +68,9 @@ extern void sharp_redistribute_vrf(struct vrf *vrf, int source); extern int sharp_zebra_srv6_manager_get_locator_chunk(const char* locator_name); extern int sharp_zebra_srv6_manager_release_locator_chunk(const char *locator_name); +extern int sharp_zebra_srv6_manager_get_locator_chunk(const char *locator_name); +extern int sharp_zebra_srv6_manager_release_locator_chunk( + const char *locator_name); extern void sharp_install_seg6local_route_helper(struct prefix *p, uint8_t instance, enum seg6local_action_t act, |