Skip to content

Commit

Permalink
zebra: rework zebra_nhg_proto_add() parameters
Browse files Browse the repository at this point in the history
This small rework prepares next commit.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Dec 8, 2023
1 parent 4a2ece9 commit 9e27760
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 9 additions & 3 deletions zebra/zebra_nhg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3357,16 +3357,22 @@ bool zebra_nhg_proto_nexthops_only(void)
}

/* Add NHE from upper level proto */
struct nhg_hash_entry *zebra_nhg_proto_add(uint32_t id, int type,
uint16_t instance, uint32_t session,
struct nhg_hash_entry *zebra_nhg_proto_add(struct nhg_hash_entry *nhe,
struct nexthop_group *nhg, afi_t afi)
{
struct nhg_hash_entry lookup;
struct nhg_hash_entry *new, *old;
struct nhg_connected *rb_node_dep = NULL;
struct nexthop *newhop;
bool replace = false;
int ret = 0;
int ret = 0, type;
uint32_t id, session;
uint16_t instance;

id = nhe->id;
type = nhe->type;
session = nhe->zapi_session;
instance = nhe->zapi_instance;

if (!nhg->nexthop) {
if (IS_ZEBRA_DEBUG_NHG)
Expand Down
5 changes: 1 addition & 4 deletions zebra/zebra_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2580,10 +2580,7 @@ static void process_subq_nhg(struct listnode *lnode)
ZAPI_NHG_REMOVE_FAIL);

} else {
newnhe = zebra_nhg_proto_add(nhe->id, nhe->type,
nhe->zapi_instance,
nhe->zapi_session,
&nhe->nhg, 0);
newnhe = zebra_nhg_proto_add(nhe, &nhe->nhg, 0);

/* Report error to daemon via ZAPI */
if (newnhe == NULL)
Expand Down

0 comments on commit 9e27760

Please sign in to comment.