diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-03-30 15:48:53 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-04-06 18:00:09 -0400 |
| commit | b589466918337c11021fd4085aacf0d7e963a9a4 (patch) | |
| tree | 9a56c43152d2733b5a1674152ac8d2c70e6dc891 /isisd/isis_te.c | |
| parent | cf35e49354699fb920997ba2448ea2088acb6a30 (diff) | |
*: Use a `struct prefix *p` instead of a `struct prefix` in functions
When passing a prefix into a function let's pass by address instead
of pass by value. Let's save our stack space.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'isisd/isis_te.c')
| -rw-r--r-- | isisd/isis_te.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/isisd/isis_te.c b/isisd/isis_te.c index c0b5f35f47..3ecd2a6f65 100644 --- a/isisd/isis_te.c +++ b/isisd/isis_te.c @@ -1077,7 +1077,7 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric, prefix_copy(&p, prefix); else { /* Remove old subnet if any before prefix adjustment */ - subnet = ls_find_subnet(args->ted, *prefix); + subnet = ls_find_subnet(args->ted, prefix); if (subnet) { if (args->export) { subnet->status = DELETE; @@ -1092,10 +1092,10 @@ static int lsp_to_subnet_cb(const struct prefix *prefix, uint32_t metric, } /* Search existing Subnet in TED ... */ - subnet = ls_find_subnet(args->ted, p); + subnet = ls_find_subnet(args->ted, &p); /* ... and create a new Subnet if not found */ if (!subnet) { - ls_pref = ls_prefix_new(vertex->node->adv, p); + ls_pref = ls_prefix_new(vertex->node->adv, &p); subnet = ls_subnet_add(args->ted, ls_pref); /* Stop processing if we are unable to create a new subnet */ if (!subnet) @@ -1835,7 +1835,7 @@ static int show_ted(struct vty *vty, struct cmd_token *argv[], int argc, return CMD_WARNING_CONFIG_FAILED; } /* Get the Subnet from the Link State Database */ - subnet = ls_find_subnet(ted, pref); + subnet = ls_find_subnet(ted, &pref); if (!subnet) { vty_out(vty, "No subnet found for ID %pFX\n", &pref); @@ -1848,7 +1848,7 @@ static int show_ted(struct vty *vty, struct cmd_token *argv[], int argc, return CMD_WARNING_CONFIG_FAILED; } /* Get the Subnet from the Link State Database */ - subnet = ls_find_subnet(ted, pref); + subnet = ls_find_subnet(ted, &pref); if (!subnet) { vty_out(vty, "No subnet found for ID %pFX\n", &pref); |
