]> git.proxmox.com Git - mirror_frr.git/blob - eigrpd/eigrp_fsm.c
topotests: RIP BFD integration topology test
[mirror_frr.git] / eigrpd / eigrp_fsm.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * EIGRPd Finite State Machine (DUAL).
4 * Copyright (C) 2013-2014
5 * Authors:
6 * Donnie Savage
7 * Jan Janovic
8 * Matej Perina
9 * Peter Orsag
10 * Peter Paluch
11 *
12 * This file contains functions for executing logic of finite state machine
13 *
14 * +------------ +
15 * | (7) |
16 * | v
17 * +=====================================+
18 * | |
19 * | Passive |
20 * | |
21 * +=====================================+
22 * ^ | ^ ^ ^ |
23 * (3)| | (1)| | (1)| |
24 * | (0)| | (3)| | (2)|
25 * | | | | | +---------------+
26 * | | | | | \
27 * +--------+ | | | +-----------------+ \
28 * / / / | \ \
29 * / / / +----+ \ \
30 * | | | | | |
31 * | v | | | v
32 * +===========+ (6) +===========+ +===========+ (6) +===========+
33 * | |------->| | (5) | |-------->| |
34 * | | (4) | |------>| | (4) | |
35 * | ACTIVE 0 |<-------| ACTIVE 1 | | ACTIVE 2 |<--------| ACTIVE 3
36 * |
37 * +--| | +--| | +--| | +--| |
38 * | +===========+ | +===========+ | +===========+ |
39 * +===========+
40 * | ^ |(5) | ^ | ^ ^ | ^
41 * | | +---------|------|------------|----+ | | |
42 * +-------+ +------+ +---------+ +---------+
43 * (7) (7) (7) (7)
44 *
45 * 0- input event other than query from successor, FC not satisfied
46 * 1- last reply, FD is reset
47 * 2- query from successor, FC not satisfied
48 * 3- last reply, FC satisfied with current value of FDij
49 * 4- distance increase while in active state
50 * 5- query from successor while in active state
51 * 6- last reply, FC not satisfied with current value of FDij
52 * 7- state not changed, usually by receiving not last reply
53 */
54
55 #include <zebra.h>
56
57 #include "frrevent.h"
58 #include "prefix.h"
59 #include "table.h"
60 #include "memory.h"
61 #include "log.h"
62 #include "linklist.h"
63 #include "vty.h"
64
65 #include "eigrpd/eigrp_types.h"
66 #include "eigrpd/eigrp_structs.h"
67 #include "eigrpd/eigrpd.h"
68 #include "eigrpd/eigrp_interface.h"
69 #include "eigrpd/eigrp_neighbor.h"
70 #include "eigrpd/eigrp_packet.h"
71 #include "eigrpd/eigrp_zebra.h"
72 #include "eigrpd/eigrp_vty.h"
73 #include "eigrpd/eigrp_network.h"
74 #include "eigrpd/eigrp_dump.h"
75 #include "eigrpd/eigrp_topology.h"
76 #include "eigrpd/eigrp_fsm.h"
77 #include "eigrpd/eigrp_metric.h"
78
79 /*
80 * Prototypes
81 */
82 int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *);
83 int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *);
84 int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *);
85 int eigrp_fsm_event_lr(struct eigrp_fsm_action_message *);
86 int eigrp_fsm_event_dinc(struct eigrp_fsm_action_message *);
87 int eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *);
88 int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *);
89 int eigrp_fsm_event_qact(struct eigrp_fsm_action_message *);
90
91 //---------------------------------------------------------------------
92
93 /*
94 * NSM - field of fields of struct containing one function each.
95 * Which function is used depends on actual state of FSM and occurred
96 * event(arrow in diagram). Usage:
97 * NSM[actual/starting state][occurred event].func
98 * Functions are should be executed within separate thread.
99 */
100 const struct {
101 int (*func)(struct eigrp_fsm_action_message *);
102 } NSM[EIGRP_FSM_STATE_MAX][EIGRP_FSM_EVENT_MAX] = {
103 {
104 // PASSIVE STATE
105 {eigrp_fsm_event_nq_fcn}, /* Event 0 */
106 {eigrp_fsm_event_keep_state}, /* Event 1 */
107 {eigrp_fsm_event_q_fcn}, /* Event 2 */
108 {eigrp_fsm_event_keep_state}, /* Event 3 */
109 {eigrp_fsm_event_keep_state}, /* Event 4 */
110 {eigrp_fsm_event_keep_state}, /* Event 5 */
111 {eigrp_fsm_event_keep_state}, /* Event 6 */
112 {eigrp_fsm_event_keep_state}, /* Event 7 */
113 },
114 {
115 // Active 0 state
116 {eigrp_fsm_event_keep_state}, /* Event 0 */
117 {eigrp_fsm_event_keep_state}, /* Event 1 */
118 {eigrp_fsm_event_keep_state}, /* Event 2 */
119 {eigrp_fsm_event_lr_fcs}, /* Event 3 */
120 {eigrp_fsm_event_keep_state}, /* Event 4 */
121 {eigrp_fsm_event_qact}, /* Event 5 */
122 {eigrp_fsm_event_lr_fcn}, /* Event 6 */
123 {eigrp_fsm_event_keep_state}, /* Event 7 */
124 },
125 {
126 // Active 1 state
127 {eigrp_fsm_event_keep_state}, /* Event 0 */
128 {eigrp_fsm_event_lr}, /* Event 1 */
129 {eigrp_fsm_event_keep_state}, /* Event 2 */
130 {eigrp_fsm_event_keep_state}, /* Event 3 */
131 {eigrp_fsm_event_dinc}, /* Event 4 */
132 {eigrp_fsm_event_qact}, /* Event 5 */
133 {eigrp_fsm_event_keep_state}, /* Event 6 */
134 {eigrp_fsm_event_keep_state}, /* Event 7 */
135 },
136 {
137 // Active 2 state
138 {eigrp_fsm_event_keep_state}, /* Event 0 */
139 {eigrp_fsm_event_keep_state}, /* Event 1 */
140 {eigrp_fsm_event_keep_state}, /* Event 2 */
141 {eigrp_fsm_event_lr_fcs}, /* Event 3 */
142 {eigrp_fsm_event_keep_state}, /* Event 4 */
143 {eigrp_fsm_event_keep_state}, /* Event 5 */
144 {eigrp_fsm_event_lr_fcn}, /* Event 6 */
145 {eigrp_fsm_event_keep_state}, /* Event 7 */
146 },
147 {
148 // Active 3 state
149 {eigrp_fsm_event_keep_state}, /* Event 0 */
150 {eigrp_fsm_event_lr}, /* Event 1 */
151 {eigrp_fsm_event_keep_state}, /* Event 2 */
152 {eigrp_fsm_event_keep_state}, /* Event 3 */
153 {eigrp_fsm_event_dinc}, /* Event 4 */
154 {eigrp_fsm_event_keep_state}, /* Event 5 */
155 {eigrp_fsm_event_keep_state}, /* Event 6 */
156 {eigrp_fsm_event_keep_state}, /* Event 7 */
157 },
158 };
159
160 static const char *packet_type2str(uint8_t packet_type)
161 {
162 if (packet_type == EIGRP_OPC_UPDATE)
163 return "Update";
164 if (packet_type == EIGRP_OPC_REQUEST)
165 return "Request";
166 if (packet_type == EIGRP_OPC_QUERY)
167 return "Query";
168 if (packet_type == EIGRP_OPC_REPLY)
169 return "Reply";
170 if (packet_type == EIGRP_OPC_HELLO)
171 return "Hello";
172 if (packet_type == EIGRP_OPC_IPXSAP)
173 return "IPXSAP";
174 if (packet_type == EIGRP_OPC_ACK)
175 return "Ack";
176 if (packet_type == EIGRP_OPC_SIAQUERY)
177 return "SIA Query";
178 if (packet_type == EIGRP_OPC_SIAREPLY)
179 return "SIA Reply";
180
181 return "Unknown";
182 }
183
184 static const char *prefix_state2str(enum eigrp_fsm_states state)
185 {
186 switch (state) {
187 case EIGRP_FSM_STATE_PASSIVE:
188 return "Passive";
189 case EIGRP_FSM_STATE_ACTIVE_0:
190 return "Active oij0";
191 case EIGRP_FSM_STATE_ACTIVE_1:
192 return "Active oij1";
193 case EIGRP_FSM_STATE_ACTIVE_2:
194 return "Active oij2";
195 case EIGRP_FSM_STATE_ACTIVE_3:
196 return "Active oij3";
197 }
198
199 return "Unknown";
200 }
201
202 static const char *fsm_state2str(enum eigrp_fsm_events event)
203 {
204 switch (event) {
205 case EIGRP_FSM_KEEP_STATE:
206 return "Keep State Event";
207 case EIGRP_FSM_EVENT_NQ_FCN:
208 return "Non Query Event Feasability not satisfied";
209 case EIGRP_FSM_EVENT_LR:
210 return "Last Reply Event";
211 case EIGRP_FSM_EVENT_Q_FCN:
212 return "Query Event Feasability not satisfied";
213 case EIGRP_FSM_EVENT_LR_FCS:
214 return "Last Reply Event Feasability satisfied";
215 case EIGRP_FSM_EVENT_DINC:
216 return "Distance Increase Event";
217 case EIGRP_FSM_EVENT_QACT:
218 return "Query from Successor while in active state";
219 case EIGRP_FSM_EVENT_LR_FCN:
220 return "Last Reply Event, Feasibility not satisfied";
221 }
222
223 return "Unknown";
224 }
225
226 static const char *change2str(enum metric_change change)
227 {
228 switch (change) {
229 case METRIC_DECREASE:
230 return "Decrease";
231 case METRIC_SAME:
232 return "Same";
233 case METRIC_INCREASE:
234 return "Increase";
235 }
236
237 return "Unknown";
238 }
239 /*
240 * Main function in which are make decisions which event occurred.
241 * msg - argument of type struct eigrp_fsm_action_message contain
242 * details about what happen
243 *
244 * Return number of occurred event (arrow in diagram).
245 *
246 */
247 static enum eigrp_fsm_events
248 eigrp_get_fsm_event(struct eigrp_fsm_action_message *msg)
249 {
250 // Loading base information from message
251 // struct eigrp *eigrp = msg->eigrp;
252 struct eigrp_prefix_descriptor *prefix = msg->prefix;
253 struct eigrp_route_descriptor *entry = msg->entry;
254 uint8_t actual_state = prefix->state;
255 enum metric_change change;
256
257 if (entry == NULL) {
258 entry = eigrp_route_descriptor_new();
259 entry->adv_router = msg->adv_router;
260 entry->ei = msg->adv_router->ei;
261 entry->prefix = prefix;
262 msg->entry = entry;
263 }
264
265 /*
266 * Calculate resultant metrics and insert to correct position
267 * in entries list
268 */
269 change = eigrp_topology_update_distance(msg);
270
271 /* Store for display later */
272 msg->change = change;
273
274 switch (actual_state) {
275 case EIGRP_FSM_STATE_PASSIVE: {
276 struct eigrp_route_descriptor *head =
277 listnode_head(prefix->entries);
278
279 if (head->reported_distance < prefix->fdistance) {
280 return EIGRP_FSM_KEEP_STATE;
281 }
282 /*
283 * if best entry doesn't satisfy feasibility condition it means
284 * move to active state
285 * dependently if it was query from successor
286 */
287 if (msg->packet_type == EIGRP_OPC_QUERY) {
288 return EIGRP_FSM_EVENT_Q_FCN;
289 } else {
290 return EIGRP_FSM_EVENT_NQ_FCN;
291 }
292
293 break;
294 }
295 case EIGRP_FSM_STATE_ACTIVE_0: {
296 if (msg->packet_type == EIGRP_OPC_REPLY) {
297 struct eigrp_route_descriptor *head =
298 listnode_head(prefix->entries);
299
300 listnode_delete(prefix->rij, entry->adv_router);
301 if (prefix->rij->count)
302 return EIGRP_FSM_KEEP_STATE;
303
304 zlog_info("All reply received");
305 if (head->reported_distance < prefix->fdistance) {
306 return EIGRP_FSM_EVENT_LR_FCS;
307 }
308
309 return EIGRP_FSM_EVENT_LR_FCN;
310 } else if (msg->packet_type == EIGRP_OPC_QUERY
311 && (entry->flags
312 & EIGRP_ROUTE_DESCRIPTOR_SUCCESSOR_FLAG)) {
313 return EIGRP_FSM_EVENT_QACT;
314 }
315
316 return EIGRP_FSM_KEEP_STATE;
317
318 break;
319 }
320 case EIGRP_FSM_STATE_ACTIVE_1: {
321 if (msg->packet_type == EIGRP_OPC_QUERY
322 && (entry->flags & EIGRP_ROUTE_DESCRIPTOR_SUCCESSOR_FLAG)) {
323 return EIGRP_FSM_EVENT_QACT;
324 } else if (msg->packet_type == EIGRP_OPC_REPLY) {
325 listnode_delete(prefix->rij, entry->adv_router);
326
327 if (change == METRIC_INCREASE
328 && (entry->flags
329 & EIGRP_ROUTE_DESCRIPTOR_SUCCESSOR_FLAG)) {
330 return EIGRP_FSM_EVENT_DINC;
331 } else if (prefix->rij->count) {
332 return EIGRP_FSM_KEEP_STATE;
333 } else {
334 zlog_info("All reply received");
335 return EIGRP_FSM_EVENT_LR;
336 }
337 } else if (msg->packet_type == EIGRP_OPC_UPDATE
338 && change == METRIC_INCREASE
339 && (entry->flags
340 & EIGRP_ROUTE_DESCRIPTOR_SUCCESSOR_FLAG)) {
341 return EIGRP_FSM_EVENT_DINC;
342 }
343 return EIGRP_FSM_KEEP_STATE;
344
345 break;
346 }
347 case EIGRP_FSM_STATE_ACTIVE_2: {
348 if (msg->packet_type == EIGRP_OPC_REPLY) {
349 struct eigrp_route_descriptor *head =
350 listnode_head(prefix->entries);
351
352 listnode_delete(prefix->rij, entry->adv_router);
353 if (prefix->rij->count) {
354 return EIGRP_FSM_KEEP_STATE;
355 } else {
356 zlog_info("All reply received");
357 if (head->reported_distance
358 < prefix->fdistance) {
359 return EIGRP_FSM_EVENT_LR_FCS;
360 }
361
362 return EIGRP_FSM_EVENT_LR_FCN;
363 }
364 }
365 return EIGRP_FSM_KEEP_STATE;
366
367 break;
368 }
369 case EIGRP_FSM_STATE_ACTIVE_3: {
370 if (msg->packet_type == EIGRP_OPC_REPLY) {
371 listnode_delete(prefix->rij, entry->adv_router);
372
373 if (change == METRIC_INCREASE
374 && (entry->flags
375 & EIGRP_ROUTE_DESCRIPTOR_SUCCESSOR_FLAG)) {
376 return EIGRP_FSM_EVENT_DINC;
377 } else if (prefix->rij->count) {
378 return EIGRP_FSM_KEEP_STATE;
379 } else {
380 zlog_info("All reply received");
381 return EIGRP_FSM_EVENT_LR;
382 }
383 } else if (msg->packet_type == EIGRP_OPC_UPDATE
384 && change == METRIC_INCREASE
385 && (entry->flags
386 & EIGRP_ROUTE_DESCRIPTOR_SUCCESSOR_FLAG)) {
387 return EIGRP_FSM_EVENT_DINC;
388 }
389 return EIGRP_FSM_KEEP_STATE;
390
391 break;
392 }
393 }
394
395 return EIGRP_FSM_KEEP_STATE;
396 }
397
398 /*
399 * Function made to execute in separate thread.
400 * Load argument from thread and execute proper NSM function
401 */
402 int eigrp_fsm_event(struct eigrp_fsm_action_message *msg)
403 {
404 enum eigrp_fsm_events event = eigrp_get_fsm_event(msg);
405
406 zlog_info(
407 "EIGRP AS: %d State: %s Event: %s Network: %pI4 Packet Type: %s Reply RIJ Count: %d change: %s",
408 msg->eigrp->AS, prefix_state2str(msg->prefix->state),
409 fsm_state2str(event), &msg->prefix->destination->u.prefix4,
410 packet_type2str(msg->packet_type), msg->prefix->rij->count,
411 change2str(msg->change));
412 (*(NSM[msg->prefix->state][event].func))(msg);
413
414 return 1;
415 }
416
417 /*
418 * Function of event 0.
419 *
420 */
421 int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *msg)
422 {
423 struct eigrp *eigrp = msg->eigrp;
424 struct eigrp_prefix_descriptor *prefix = msg->prefix;
425 struct list *successors = eigrp_topology_get_successor(prefix);
426 struct eigrp_route_descriptor *ne;
427
428 assert(successors); // If this is NULL we have shit the bed, fun huh?
429
430 ne = listnode_head(successors);
431 prefix->state = EIGRP_FSM_STATE_ACTIVE_1;
432 prefix->rdistance = prefix->distance = prefix->fdistance = ne->distance;
433 prefix->reported_metric = ne->total_metric;
434
435 if (eigrp_nbr_count_get(eigrp)) {
436 prefix->req_action |= EIGRP_FSM_NEED_QUERY;
437 listnode_add(eigrp->topology_changes_internalIPV4, prefix);
438 } else {
439 eigrp_fsm_event_lr(msg); // in the case that there are no more
440 // neighbors left
441 }
442
443 list_delete(&successors);
444
445 return 1;
446 }
447
448 int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *msg)
449 {
450 struct eigrp *eigrp = msg->eigrp;
451 struct eigrp_prefix_descriptor *prefix = msg->prefix;
452 struct list *successors = eigrp_topology_get_successor(prefix);
453 struct eigrp_route_descriptor *ne;
454
455 assert(successors); // If this is NULL somebody poked us in the eye.
456
457 ne = listnode_head(successors);
458 prefix->state = EIGRP_FSM_STATE_ACTIVE_3;
459 prefix->rdistance = prefix->distance = prefix->fdistance = ne->distance;
460 prefix->reported_metric = ne->total_metric;
461 if (eigrp_nbr_count_get(eigrp)) {
462 prefix->req_action |= EIGRP_FSM_NEED_QUERY;
463 listnode_add(eigrp->topology_changes_internalIPV4, prefix);
464 } else {
465 eigrp_fsm_event_lr(msg); // in the case that there are no more
466 // neighbors left
467 }
468
469 list_delete(&successors);
470
471 return 1;
472 }
473
474 int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *msg)
475 {
476 struct eigrp *eigrp = msg->eigrp;
477 struct eigrp_prefix_descriptor *prefix = msg->prefix;
478 struct eigrp_route_descriptor *ne = listnode_head(prefix->entries);
479
480 if (prefix->state == EIGRP_FSM_STATE_PASSIVE) {
481 if (!eigrp_metrics_is_same(prefix->reported_metric,
482 ne->total_metric)) {
483 prefix->rdistance = prefix->fdistance =
484 prefix->distance = ne->distance;
485 prefix->reported_metric = ne->total_metric;
486 if (msg->packet_type == EIGRP_OPC_QUERY)
487 eigrp_send_reply(msg->adv_router, prefix);
488 prefix->req_action |= EIGRP_FSM_NEED_UPDATE;
489 listnode_add(eigrp->topology_changes_internalIPV4,
490 prefix);
491 }
492 eigrp_topology_update_node_flags(eigrp, prefix);
493 eigrp_update_routing_table(eigrp, prefix);
494 }
495
496 if (msg->packet_type == EIGRP_OPC_QUERY)
497 eigrp_send_reply(msg->adv_router, prefix);
498
499 return 1;
500 }
501
502 int eigrp_fsm_event_lr(struct eigrp_fsm_action_message *msg)
503 {
504 struct eigrp *eigrp = msg->eigrp;
505 struct eigrp_prefix_descriptor *prefix = msg->prefix;
506 struct eigrp_route_descriptor *ne = listnode_head(prefix->entries);
507
508 prefix->fdistance = prefix->distance = prefix->rdistance = ne->distance;
509 prefix->reported_metric = ne->total_metric;
510
511 if (prefix->state == EIGRP_FSM_STATE_ACTIVE_3) {
512 struct list *successors = eigrp_topology_get_successor(prefix);
513
514 assert(successors); // It's like Napolean and Waterloo
515
516 ne = listnode_head(successors);
517 eigrp_send_reply(ne->adv_router, prefix);
518 list_delete(&successors);
519 }
520
521 prefix->state = EIGRP_FSM_STATE_PASSIVE;
522 prefix->req_action |= EIGRP_FSM_NEED_UPDATE;
523 listnode_add(eigrp->topology_changes_internalIPV4, prefix);
524 eigrp_topology_update_node_flags(eigrp, prefix);
525 eigrp_update_routing_table(eigrp, prefix);
526 eigrp_update_topology_table_prefix(eigrp, eigrp->topology_table,
527 prefix);
528
529 return 1;
530 }
531
532 int eigrp_fsm_event_dinc(struct eigrp_fsm_action_message *msg)
533 {
534 struct list *successors = eigrp_topology_get_successor(msg->prefix);
535 struct eigrp_route_descriptor *ne;
536
537 assert(successors); // Trump and his big hands
538
539 ne = listnode_head(successors);
540 msg->prefix->state = msg->prefix->state == EIGRP_FSM_STATE_ACTIVE_1
541 ? EIGRP_FSM_STATE_ACTIVE_0
542 : EIGRP_FSM_STATE_ACTIVE_2;
543 msg->prefix->distance = ne->distance;
544 if (!msg->prefix->rij->count)
545 (*(NSM[msg->prefix->state][eigrp_get_fsm_event(msg)].func))(
546 msg);
547
548
549 list_delete(&successors);
550 return 1;
551 }
552
553 int eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *msg)
554 {
555 struct eigrp *eigrp = msg->eigrp;
556 struct eigrp_prefix_descriptor *prefix = msg->prefix;
557 struct eigrp_route_descriptor *ne = listnode_head(prefix->entries);
558
559 prefix->state = EIGRP_FSM_STATE_PASSIVE;
560 prefix->distance = prefix->rdistance = ne->distance;
561 prefix->reported_metric = ne->total_metric;
562 prefix->fdistance = prefix->fdistance > prefix->distance
563 ? prefix->distance
564 : prefix->fdistance;
565 if (prefix->state == EIGRP_FSM_STATE_ACTIVE_2) {
566 struct list *successors = eigrp_topology_get_successor(prefix);
567
568 assert(successors); // Having a spoon and all you need is a
569 // knife
570 ne = listnode_head(successors);
571 eigrp_send_reply(ne->adv_router, prefix);
572
573 list_delete(&successors);
574 }
575 prefix->req_action |= EIGRP_FSM_NEED_UPDATE;
576 listnode_add(eigrp->topology_changes_internalIPV4, prefix);
577 eigrp_topology_update_node_flags(eigrp, prefix);
578 eigrp_update_routing_table(eigrp, prefix);
579 eigrp_update_topology_table_prefix(eigrp, eigrp->topology_table,
580 prefix);
581
582 return 1;
583 }
584
585 int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *msg)
586 {
587 struct eigrp *eigrp = msg->eigrp;
588 struct eigrp_prefix_descriptor *prefix = msg->prefix;
589 struct eigrp_route_descriptor *best_successor;
590 struct list *successors = eigrp_topology_get_successor(prefix);
591
592 assert(successors); // Routing without a stack
593
594 prefix->state = prefix->state == EIGRP_FSM_STATE_ACTIVE_0
595 ? EIGRP_FSM_STATE_ACTIVE_1
596 : EIGRP_FSM_STATE_ACTIVE_3;
597
598 best_successor = listnode_head(successors);
599 prefix->rdistance = prefix->distance = best_successor->distance;
600 prefix->reported_metric = best_successor->total_metric;
601
602 if (eigrp_nbr_count_get(eigrp)) {
603 prefix->req_action |= EIGRP_FSM_NEED_QUERY;
604 listnode_add(eigrp->topology_changes_internalIPV4, prefix);
605 } else {
606 eigrp_fsm_event_lr(msg); // in the case that there are no more
607 // neighbors left
608 }
609
610 list_delete(&successors);
611
612 return 1;
613 }
614
615 int eigrp_fsm_event_qact(struct eigrp_fsm_action_message *msg)
616 {
617 struct list *successors = eigrp_topology_get_successor(msg->prefix);
618 struct eigrp_route_descriptor *ne;
619
620 assert(successors); // Cats and no Dogs
621
622 ne = listnode_head(successors);
623 msg->prefix->state = EIGRP_FSM_STATE_ACTIVE_2;
624 msg->prefix->distance = ne->distance;
625
626 list_delete(&successors);
627 return 1;
628 }