diff options
| author | Mark Stapp <mjs@cisco.com> | 2024-08-09 10:08:21 -0400 |
|---|---|---|
| committer | Mark Stapp <mjs@cisco.com> | 2024-08-09 10:08:21 -0400 |
| commit | 3eb7d1641166872591554519607483f6d77657f5 (patch) | |
| tree | 9c10fe0e038466b31fbe381e9da8ca316457e7a3 /isisd/isis_pdu.c | |
| parent | e7fd713afcea95a816723aa417928c8225453d19 (diff) | |
isisd: fix memory handling in isis_adj_process_threeway()
The adj_process_threeway() api may call the adj_state_change()
api, which may delete the adj struct being examined. Change the
signature so that callers pass a ptr-to-ptr so that they will
see that deletion.
Signed-off-by: Mark Stapp <mjs@cisco.com>
Diffstat (limited to 'isisd/isis_pdu.c')
| -rw-r--r-- | isisd/isis_pdu.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index 5be317018e..23238d314a 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -281,14 +281,14 @@ static int process_p2p_hello(struct iih_info *iih) if (iih->calculated_type == IS_LEVEL_1) { switch (iih->circ_type) { case IS_LEVEL_1: - isis_adj_process_threeway(adj, tw_adj, + isis_adj_process_threeway(&adj, tw_adj, iih->calculated_type); break; case IS_LEVEL_1_AND_2: if ((adj->adj_state != ISIS_ADJ_UP) || (adj->adj_usage == ISIS_ADJ_LEVEL1) || (adj->adj_usage == ISIS_ADJ_LEVEL1AND2)) { - isis_adj_process_threeway(adj, tw_adj, + isis_adj_process_threeway(&adj, tw_adj, iih->calculated_type); } break; @@ -301,7 +301,7 @@ static int process_p2p_hello(struct iih_info *iih) case IS_LEVEL_1: if (adj->adj_state != ISIS_ADJ_UP || adj->adj_usage == ISIS_ADJ_LEVEL1) { - isis_adj_process_threeway(adj, tw_adj, + isis_adj_process_threeway(&adj, tw_adj, iih->calculated_type); } else if ((adj->adj_usage == ISIS_ADJ_LEVEL2) || (adj->adj_usage == @@ -315,7 +315,7 @@ static int process_p2p_hello(struct iih_info *iih) case IS_LEVEL_2: if (adj->adj_state != ISIS_ADJ_UP || adj->adj_usage == ISIS_ADJ_LEVEL2) { - isis_adj_process_threeway(adj, tw_adj, + isis_adj_process_threeway(&adj, tw_adj, iih->calculated_type); } else if ((adj->adj_usage == ISIS_ADJ_LEVEL1) || (adj->adj_usage == @@ -329,7 +329,7 @@ static int process_p2p_hello(struct iih_info *iih) case IS_LEVEL_1_AND_2: if (adj->adj_state != ISIS_ADJ_UP || adj->adj_usage == ISIS_ADJ_LEVEL1AND2) { - isis_adj_process_threeway(adj, tw_adj, + isis_adj_process_threeway(&adj, tw_adj, iih->calculated_type); } else if ((adj->adj_usage == ISIS_ADJ_LEVEL1) || (adj->adj_usage == ISIS_ADJ_LEVEL2)) { @@ -349,12 +349,12 @@ static int process_p2p_hello(struct iih_info *iih) if (adj->adj_state != ISIS_ADJ_UP || adj->adj_usage == ISIS_ADJ_LEVEL2 || adj->adj_usage == ISIS_ADJ_LEVEL1AND2) { - isis_adj_process_threeway(adj, tw_adj, + isis_adj_process_threeway(&adj, tw_adj, iih->calculated_type); } break; case IS_LEVEL_2: - isis_adj_process_threeway(adj, tw_adj, + isis_adj_process_threeway(&adj, tw_adj, iih->calculated_type); break; } @@ -401,7 +401,7 @@ static int process_p2p_hello(struct iih_info *iih) case IS_LEVEL_2: if (adj->adj_state != ISIS_ADJ_UP || adj->adj_usage == ISIS_ADJ_LEVEL2) { - isis_adj_process_threeway(adj, tw_adj, + isis_adj_process_threeway(&adj, tw_adj, iih->calculated_type); } else if (adj->adj_usage == ISIS_ADJ_LEVEL1) { /* (7) down - wrong system */ |
