]> git.proxmox.com Git - mirror_frr.git/blob - ospfd/ospf_ia.c
Merge branch 'stable/3.0'
[mirror_frr.git] / ospfd / ospf_ia.c
1 /*
2 * OSPF inter-area routing.
3 * Copyright (C) 1999, 2000 Alex Zinin, Toshiaki Takada
4 *
5 * This file is part of GNU Zebra.
6 *
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22
23 #include <zebra.h>
24
25 #include "thread.h"
26 #include "memory.h"
27 #include "hash.h"
28 #include "linklist.h"
29 #include "prefix.h"
30 #include "table.h"
31 #include "log.h"
32
33 #include "ospfd/ospfd.h"
34 #include "ospfd/ospf_interface.h"
35 #include "ospfd/ospf_ism.h"
36 #include "ospfd/ospf_asbr.h"
37 #include "ospfd/ospf_lsa.h"
38 #include "ospfd/ospf_lsdb.h"
39 #include "ospfd/ospf_neighbor.h"
40 #include "ospfd/ospf_nsm.h"
41 #include "ospfd/ospf_spf.h"
42 #include "ospfd/ospf_route.h"
43 #include "ospfd/ospf_ase.h"
44 #include "ospfd/ospf_abr.h"
45 #include "ospfd/ospf_ia.h"
46 #include "ospfd/ospf_dump.h"
47
48 static struct ospf_route *
49 ospf_find_abr_route (struct route_table *rtrs,
50 struct prefix_ipv4 *abr,
51 struct ospf_area *area)
52 {
53 struct route_node *rn;
54 struct ospf_route *or;
55 struct listnode *node;
56
57 if ((rn = route_node_lookup (rtrs, (struct prefix *) abr)) == NULL)
58 return NULL;
59
60 route_unlock_node (rn);
61
62 for (ALL_LIST_ELEMENTS_RO ((struct list *) rn->info, node, or))
63 if (IPV4_ADDR_SAME (&or->u.std.area_id, &area->area_id)
64 && (or->u.std.flags & ROUTER_LSA_BORDER))
65 return or;
66
67 return NULL;
68 }
69
70 static void
71 ospf_ia_network_route (struct ospf *ospf, struct route_table *rt,
72 struct prefix_ipv4 *p, struct ospf_route *new_or,
73 struct ospf_route *abr_or)
74 {
75 struct route_node *rn1;
76 struct ospf_route *or;
77
78 if (IS_DEBUG_OSPF_EVENT)
79 zlog_debug ("ospf_ia_network_route(): processing summary route to %s/%d",
80 inet_ntoa (p->prefix), p->prefixlen);
81
82 /* Find a route to the same dest */
83 if ((rn1 = route_node_lookup (rt, (struct prefix *) p)))
84 {
85 int res;
86
87 route_unlock_node (rn1);
88
89 if ((or = rn1->info))
90 {
91 if (IS_DEBUG_OSPF_EVENT)
92 zlog_debug ("ospf_ia_network_route(): "
93 "Found a route to the same network");
94 /* Check the existing route. */
95 if ((res = ospf_route_cmp (ospf, new_or, or)) < 0)
96 {
97 /* New route is better, so replace old one. */
98 ospf_route_subst (rn1, new_or, abr_or);
99 }
100 else if (res == 0)
101 {
102 /* New and old route are equal, so next hops can be added. */
103 route_lock_node (rn1);
104 ospf_route_copy_nexthops (or, abr_or->paths);
105 route_unlock_node (rn1);
106
107 /* new route can be deleted, because existing route has been updated. */
108 ospf_route_free (new_or);
109 }
110 else
111 {
112 /* New route is worse, so free it. */
113 ospf_route_free (new_or);
114 return;
115 }
116 } /* if (or)*/
117 } /*if (rn1)*/
118 else
119 { /* no route */
120 if (IS_DEBUG_OSPF_EVENT)
121 zlog_debug ("ospf_ia_network_route(): add new route to %s/%d",
122 inet_ntoa (p->prefix), p->prefixlen);
123 ospf_route_add (rt, p, new_or, abr_or);
124 }
125 }
126
127 static void
128 ospf_ia_router_route (struct ospf *ospf, struct route_table *rtrs,
129 struct prefix_ipv4 *p,
130 struct ospf_route *new_or, struct ospf_route *abr_or)
131 {
132 struct ospf_route *or = NULL;
133 struct route_node *rn;
134 int ret;
135
136 if (IS_DEBUG_OSPF_EVENT)
137 zlog_debug ("ospf_ia_router_route(): considering %s/%d",
138 inet_ntoa (p->prefix), p->prefixlen);
139 /* Find a route to the same dest */
140 rn = route_node_get (rtrs, (struct prefix *) p);
141
142 if (rn->info == NULL)
143 /* This is a new route */
144 rn->info = list_new ();
145 else
146 {
147 struct ospf_area *or_area;
148 or_area = ospf_area_lookup_by_area_id (ospf, new_or->u.std.area_id);
149 assert (or_area);
150 /* This is an additional route */
151 route_unlock_node (rn);
152 or = ospf_find_asbr_route_through_area (rtrs, p, or_area);
153 }
154
155 if (or)
156 {
157 if (IS_DEBUG_OSPF_EVENT)
158 zlog_debug ("ospf_ia_router_route(): "
159 "a route to the same ABR through the same area exists");
160 /* New route is better */
161 if ((ret = ospf_route_cmp (ospf, new_or, or)) < 0)
162 {
163 listnode_delete (rn->info, or);
164 ospf_route_free (or);
165 /* proceed down */
166 }
167 /* Routes are the same */
168 else if (ret == 0)
169 {
170 if (IS_DEBUG_OSPF_EVENT)
171 zlog_debug ("ospf_ia_router_route(): merging the new route");
172
173 ospf_route_copy_nexthops (or, abr_or->paths);
174 ospf_route_free (new_or);
175 return;
176 }
177 /* New route is worse */
178 else
179 {
180 if (IS_DEBUG_OSPF_EVENT)
181 zlog_debug ("ospf_ia_router_route(): skipping the new route");
182 ospf_route_free (new_or);
183 return;
184 }
185 }
186
187 ospf_route_copy_nexthops (new_or, abr_or->paths);
188
189 if (IS_DEBUG_OSPF_EVENT)
190 zlog_debug ("ospf_ia_router_route(): adding the new route");
191
192 listnode_add (rn->info, new_or);
193 }
194
195
196 static int
197 process_summary_lsa (struct ospf_area *area, struct route_table *rt,
198 struct route_table *rtrs, struct ospf_lsa *lsa)
199 {
200 struct ospf *ospf = area->ospf;
201 struct ospf_area_range *range;
202 struct ospf_route *abr_or, *new_or;
203 struct summary_lsa *sl;
204 struct prefix_ipv4 p, abr;
205 u_int32_t metric;
206
207 if (lsa == NULL)
208 return 0;
209
210 sl = (struct summary_lsa *) lsa->data;
211
212 if (IS_DEBUG_OSPF_EVENT)
213 zlog_debug ("process_summary_lsa(): LS ID: %s", inet_ntoa (sl->header.id));
214
215 metric = GET_METRIC (sl->metric);
216
217 if (metric == OSPF_LS_INFINITY)
218 return 0;
219
220 if (IS_LSA_MAXAGE (lsa))
221 return 0;
222
223 if (ospf_lsa_is_self_originated (area->ospf, lsa))
224 return 0;
225
226 p.family = AF_INET;
227 p.prefix = sl->header.id;
228
229 if (sl->header.type == OSPF_SUMMARY_LSA)
230 p.prefixlen = ip_masklen (sl->mask);
231 else
232 p.prefixlen = IPV4_MAX_BITLEN;
233
234 apply_mask_ipv4 (&p);
235
236 if (sl->header.type == OSPF_SUMMARY_LSA &&
237 (range = ospf_area_range_match_any (ospf, &p)) &&
238 ospf_area_range_active (range))
239 return 0;
240
241 /* XXX: This check seems dubious to me. If an ABR has already decided
242 * to consider summaries received in this area, then why would one wish
243 * to exclude default?
244 */
245 if (IS_OSPF_ABR(ospf) &&
246 ospf->abr_type != OSPF_ABR_STAND &&
247 area->external_routing != OSPF_AREA_DEFAULT &&
248 p.prefix.s_addr == OSPF_DEFAULT_DESTINATION &&
249 p.prefixlen == 0)
250 return 0; /* Ignore summary default from a stub area */
251
252 abr.family = AF_INET;
253 abr.prefix = sl->header.adv_router;
254 abr.prefixlen = IPV4_MAX_BITLEN;
255 apply_mask_ipv4 (&abr);
256
257 abr_or = ospf_find_abr_route (rtrs, &abr, area);
258
259 if (abr_or == NULL)
260 return 0;
261
262 new_or = ospf_route_new ();
263 new_or->type = OSPF_DESTINATION_NETWORK;
264 new_or->id = sl->header.id;
265 new_or->mask = sl->mask;
266 new_or->u.std.options = sl->header.options;
267 new_or->u.std.origin = (struct lsa_header *) sl;
268 new_or->cost = abr_or->cost + metric;
269 new_or->u.std.area_id = area->area_id;
270 new_or->u.std.external_routing = area->external_routing;
271 new_or->path_type = OSPF_PATH_INTER_AREA;
272
273 if (sl->header.type == OSPF_SUMMARY_LSA)
274 ospf_ia_network_route (ospf, rt, &p, new_or, abr_or);
275 else
276 {
277 new_or->type = OSPF_DESTINATION_ROUTER;
278 new_or->u.std.flags = ROUTER_LSA_EXTERNAL;
279 ospf_ia_router_route (ospf, rtrs, &p, new_or, abr_or);
280 }
281
282 return 0;
283 }
284
285 static void
286 ospf_examine_summaries (struct ospf_area *area,
287 struct route_table *lsdb_rt,
288 struct route_table *rt,
289 struct route_table *rtrs)
290 {
291 struct ospf_lsa *lsa;
292 struct route_node *rn;
293
294 LSDB_LOOP (lsdb_rt, rn, lsa)
295 process_summary_lsa (area, rt, rtrs, lsa);
296 }
297
298 int
299 ospf_area_is_transit (struct ospf_area *area)
300 {
301 return (area->transit == OSPF_TRANSIT_TRUE) ||
302 ospf_full_virtual_nbrs(area); /* Cisco forgets to set the V-bit :( */
303 }
304
305 static void
306 ospf_update_network_route (struct ospf *ospf,
307 struct route_table *rt,
308 struct route_table *rtrs,
309 struct summary_lsa *lsa,
310 struct prefix_ipv4 *p,
311 struct ospf_area *area)
312 {
313 struct route_node *rn;
314 struct ospf_route *or, *abr_or, *new_or;
315 struct prefix_ipv4 abr;
316 u_int32_t cost;
317
318 abr.family = AF_INET;
319 abr.prefix =lsa->header.adv_router;
320 abr.prefixlen = IPV4_MAX_BITLEN;
321 apply_mask_ipv4 (&abr);
322
323 abr_or = ospf_find_abr_route (rtrs, &abr, area);
324
325 if (abr_or == NULL)
326 {
327 if (IS_DEBUG_OSPF_EVENT)
328 zlog_debug ("ospf_update_network_route(): can't find a route to the ABR");
329 return;
330 }
331
332 cost = abr_or->cost + GET_METRIC (lsa->metric);
333
334 rn = route_node_lookup (rt, (struct prefix *) p);
335
336 if (! rn)
337 {
338 if (ospf->abr_type != OSPF_ABR_SHORTCUT)
339 return; /* Standard ABR can update only already installed
340 backbone paths */
341 if (IS_DEBUG_OSPF_EVENT)
342 zlog_debug ("ospf_update_network_route(): "
343 "Allowing Shortcut ABR to add new route");
344 new_or = ospf_route_new ();
345 new_or->type = OSPF_DESTINATION_NETWORK;
346 new_or->id = lsa->header.id;
347 new_or->mask = lsa->mask;
348 new_or->u.std.options = lsa->header.options;
349 new_or->u.std.origin = (struct lsa_header *) lsa;
350 new_or->cost = cost;
351 new_or->u.std.area_id = area->area_id;
352 new_or->u.std.external_routing = area->external_routing;
353 new_or->path_type = OSPF_PATH_INTER_AREA;
354 ospf_route_add (rt, p, new_or, abr_or);
355
356 return;
357 }
358 else
359 {
360 route_unlock_node (rn);
361 if (rn->info == NULL)
362 return;
363 }
364
365 or = rn->info;
366
367 if (or->path_type != OSPF_PATH_INTRA_AREA &&
368 or->path_type != OSPF_PATH_INTER_AREA)
369 {
370 if (IS_DEBUG_OSPF_EVENT)
371 zlog_debug ("ospf_update_network_route(): ERR: path type is wrong");
372 return;
373 }
374
375 if (ospf->abr_type == OSPF_ABR_SHORTCUT)
376 {
377 if (or->path_type == OSPF_PATH_INTRA_AREA &&
378 !OSPF_IS_AREA_ID_BACKBONE (or->u.std.area_id))
379 {
380 if (IS_DEBUG_OSPF_EVENT)
381 zlog_debug ("ospf_update_network_route(): Shortcut: "
382 "this intra-area path is not backbone");
383 return;
384 }
385 }
386 else /* Not Shortcut ABR */
387 {
388 if (!OSPF_IS_AREA_ID_BACKBONE (or->u.std.area_id))
389 {
390 if (IS_DEBUG_OSPF_EVENT)
391 zlog_debug ("ospf_update_network_route(): "
392 "route is not BB-associated");
393 return; /* We can update only BB routes */
394 }
395 }
396
397 if (or->cost < cost)
398 {
399 if (IS_DEBUG_OSPF_EVENT)
400 zlog_debug ("ospf_update_network_route(): new route is worse");
401 return;
402 }
403
404 if (or->cost == cost)
405 {
406 if (IS_DEBUG_OSPF_EVENT)
407 zlog_debug ("ospf_update_network_route(): "
408 "new route is same distance, adding nexthops");
409 ospf_route_copy_nexthops (or, abr_or->paths);
410 }
411
412 if (or->cost > cost)
413 {
414 if (IS_DEBUG_OSPF_EVENT)
415 zlog_debug ("ospf_update_network_route(): "
416 "new route is better, overriding nexthops");
417 ospf_route_subst_nexthops (or, abr_or->paths);
418 or->cost = cost;
419
420 if ((ospf->abr_type == OSPF_ABR_SHORTCUT) &&
421 !OSPF_IS_AREA_ID_BACKBONE (or->u.std.area_id))
422 {
423 or->path_type = OSPF_PATH_INTER_AREA;
424 or->u.std.area_id = area->area_id;
425 or->u.std.external_routing = area->external_routing;
426 /* Note that we can do this only in Shortcut ABR mode,
427 because standard ABR must leave the route type and area
428 unchanged
429 */
430 }
431 }
432 }
433
434 static void
435 ospf_update_router_route (struct ospf *ospf,
436 struct route_table *rtrs,
437 struct summary_lsa *lsa,
438 struct prefix_ipv4 *p,
439 struct ospf_area *area)
440 {
441 struct ospf_route *or, *abr_or, *new_or;
442 struct prefix_ipv4 abr;
443 u_int32_t cost;
444
445 abr.family = AF_INET;
446 abr.prefix = lsa->header.adv_router;
447 abr.prefixlen = IPV4_MAX_BITLEN;
448 apply_mask_ipv4 (&abr);
449
450 abr_or = ospf_find_abr_route (rtrs, &abr, area);
451
452 if (abr_or == NULL)
453 {
454 if (IS_DEBUG_OSPF_EVENT)
455 zlog_debug ("ospf_update_router_route(): can't find a route to the ABR");
456 return;
457 }
458
459 cost = abr_or->cost + GET_METRIC (lsa->metric);
460
461 /* First try to find a backbone path,
462 because standard ABR can update only BB-associated paths */
463
464 if ((ospf->backbone == NULL) &&
465 (ospf->abr_type != OSPF_ABR_SHORTCUT))
466 return; /* no BB area, not Shortcut ABR, exiting */
467
468 /* find the backbone route, if possible */
469 if ((ospf->backbone == NULL)
470 || !(or = ospf_find_asbr_route_through_area (rtrs, p, ospf->backbone)))
471 {
472 if (ospf->abr_type != OSPF_ABR_SHORTCUT)
473
474 /* route to ASBR through the BB not found
475 the router is not Shortcut ABR, exiting */
476
477 return;
478 else
479 /* We're a Shortcut ABR*/
480 {
481 /* Let it either add a new router or update the route
482 through the same (non-BB) area. */
483
484 new_or = ospf_route_new ();
485 new_or->type = OSPF_DESTINATION_ROUTER;
486 new_or->id = lsa->header.id;
487 new_or->mask = lsa->mask;
488 new_or->u.std.options = lsa->header.options;
489 new_or->u.std.origin = (struct lsa_header *)lsa;
490 new_or->cost = cost;
491 new_or->u.std.area_id = area->area_id;
492 new_or->u.std.external_routing = area->external_routing;
493 new_or->path_type = OSPF_PATH_INTER_AREA;
494 new_or->u.std.flags = ROUTER_LSA_EXTERNAL;
495 ospf_ia_router_route (ospf, rtrs, p, new_or, abr_or);
496
497 return;
498 }
499 }
500
501 /* At this point the "or" is always bb-associated */
502
503 if (!(or->u.std.flags & ROUTER_LSA_EXTERNAL))
504 {
505 if (IS_DEBUG_OSPF_EVENT)
506 zlog_debug ("ospf_upd_router_route(): the remote router is not an ASBR");
507 return;
508 }
509
510 if (or->path_type != OSPF_PATH_INTRA_AREA &&
511 or->path_type != OSPF_PATH_INTER_AREA)
512 return;
513
514 if (or->cost < cost)
515 return;
516
517 else if (or->cost == cost)
518 ospf_route_copy_nexthops (or, abr_or->paths);
519
520 else if (or->cost > cost)
521 {
522 ospf_route_subst_nexthops (or, abr_or->paths);
523 or->cost = cost;
524
525 /* Even if the ABR runs in Shortcut mode, we can't change
526 the path type and area, because the "or" is always bb-associated
527 at this point and even Shortcut ABR can't change these attributes */
528 }
529 }
530
531 static int
532 process_transit_summary_lsa (struct ospf_area *area, struct route_table *rt,
533 struct route_table *rtrs, struct ospf_lsa *lsa)
534 {
535 struct ospf *ospf = area->ospf;
536 struct summary_lsa *sl;
537 struct prefix_ipv4 p;
538 u_int32_t metric;
539
540 if (lsa == NULL)
541 return 0;
542
543 sl = (struct summary_lsa *) lsa->data;
544
545 if (IS_DEBUG_OSPF_EVENT)
546 zlog_debug ("process_transit_summaries(): LS ID: %s",
547 inet_ntoa (lsa->data->id));
548 metric = GET_METRIC (sl->metric);
549
550 if (metric == OSPF_LS_INFINITY)
551 {
552 if (IS_DEBUG_OSPF_EVENT)
553 zlog_debug ("process_transit_summaries(): metric is infinity, skip");
554 return 0;
555 }
556
557 if (IS_LSA_MAXAGE (lsa))
558 {
559 if (IS_DEBUG_OSPF_EVENT)
560 zlog_debug ("process_transit_summaries(): This LSA is too old");
561 return 0;
562 }
563
564 if (ospf_lsa_is_self_originated (area->ospf, lsa))
565 {
566 if (IS_DEBUG_OSPF_EVENT)
567 zlog_debug ("process_transit_summaries(): This LSA is mine, skip");
568 return 0;
569 }
570
571 p.family = AF_INET;
572 p.prefix = sl->header.id;
573
574 if (sl->header.type == OSPF_SUMMARY_LSA)
575 p.prefixlen = ip_masklen (sl->mask);
576 else
577 p.prefixlen = IPV4_MAX_BITLEN;
578
579 apply_mask_ipv4 (&p);
580
581 if (sl->header.type == OSPF_SUMMARY_LSA)
582 ospf_update_network_route (ospf, rt, rtrs, sl, &p, area);
583 else
584 ospf_update_router_route (ospf, rtrs, sl, &p, area);
585
586 return 0;
587 }
588
589 static void
590 ospf_examine_transit_summaries (struct ospf_area *area,
591 struct route_table *lsdb_rt,
592 struct route_table *rt,
593 struct route_table *rtrs)
594 {
595 struct ospf_lsa *lsa;
596 struct route_node *rn;
597
598 LSDB_LOOP (lsdb_rt, rn, lsa)
599 process_transit_summary_lsa (area, rt, rtrs, lsa);
600 }
601
602 void
603 ospf_ia_routing (struct ospf *ospf,
604 struct route_table *rt,
605 struct route_table *rtrs)
606 {
607 struct ospf_area * area;
608
609 if (IS_DEBUG_OSPF_EVENT)
610 zlog_debug ("ospf_ia_routing():start");
611
612 if (IS_OSPF_ABR (ospf))
613 {
614 struct listnode *node;
615 struct ospf_area *area;
616
617 switch (ospf->abr_type)
618 {
619 case OSPF_ABR_STAND:
620 if (IS_DEBUG_OSPF_EVENT)
621 zlog_debug ("ospf_ia_routing():Standard ABR");
622
623 if ((area = ospf->backbone))
624 {
625 struct listnode *node;
626
627 if (IS_DEBUG_OSPF_EVENT)
628 {
629 zlog_debug ("ospf_ia_routing():backbone area found");
630 zlog_debug ("ospf_ia_routing():examining summaries");
631 }
632
633 OSPF_EXAMINE_SUMMARIES_ALL (area, rt, rtrs);
634
635 for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area))
636 if (area != ospf->backbone)
637 if (ospf_area_is_transit (area))
638 OSPF_EXAMINE_TRANSIT_SUMMARIES_ALL (area, rt, rtrs);
639 }
640 else
641 if (IS_DEBUG_OSPF_EVENT)
642 zlog_debug ("ospf_ia_routing():backbone area NOT found");
643 break;
644 case OSPF_ABR_IBM:
645 case OSPF_ABR_CISCO:
646 if (IS_DEBUG_OSPF_EVENT)
647 zlog_debug ("ospf_ia_routing():Alternative Cisco/IBM ABR");
648 area = ospf->backbone; /* Find the BB */
649
650 /* If we have an active BB connection */
651 if (area && ospf_act_bb_connection (ospf))
652 {
653 if (IS_DEBUG_OSPF_EVENT)
654 {
655 zlog_debug ("ospf_ia_routing(): backbone area found");
656 zlog_debug ("ospf_ia_routing(): examining BB summaries");
657 }
658
659 OSPF_EXAMINE_SUMMARIES_ALL (area, rt, rtrs);
660
661 for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area))
662 if (area != ospf->backbone)
663 if (ospf_area_is_transit (area))
664 OSPF_EXAMINE_TRANSIT_SUMMARIES_ALL (area, rt, rtrs);
665 }
666 else
667 { /* No active BB connection--consider all areas */
668 if (IS_DEBUG_OSPF_EVENT)
669 zlog_debug ("ospf_ia_routing(): "
670 "Active BB connection not found");
671 for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area))
672 OSPF_EXAMINE_SUMMARIES_ALL (area, rt, rtrs);
673 }
674 break;
675 case OSPF_ABR_SHORTCUT:
676 if (IS_DEBUG_OSPF_EVENT)
677 zlog_debug ("ospf_ia_routing():Alternative Shortcut");
678 area = ospf->backbone; /* Find the BB */
679
680 /* If we have an active BB connection */
681 if (area && ospf_act_bb_connection (ospf))
682 {
683 if (IS_DEBUG_OSPF_EVENT)
684 {
685 zlog_debug ("ospf_ia_routing(): backbone area found");
686 zlog_debug ("ospf_ia_routing(): examining BB summaries");
687 }
688 OSPF_EXAMINE_SUMMARIES_ALL (area, rt, rtrs);
689 }
690
691 for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area))
692 if (area != ospf->backbone)
693 if (ospf_area_is_transit (area) ||
694 ((area->shortcut_configured != OSPF_SHORTCUT_DISABLE) &&
695 ((ospf->backbone == NULL) ||
696 ((area->shortcut_configured == OSPF_SHORTCUT_ENABLE) &&
697 area->shortcut_capability))))
698 OSPF_EXAMINE_TRANSIT_SUMMARIES_ALL (area, rt, rtrs);
699 break;
700 default:
701 break;
702 }
703 }
704 else
705 {
706 struct listnode *node;
707
708 if (IS_DEBUG_OSPF_EVENT)
709 zlog_debug ("ospf_ia_routing():not ABR, considering all areas");
710
711 for (ALL_LIST_ELEMENTS_RO (ospf->areas, node, area))
712 OSPF_EXAMINE_SUMMARIES_ALL (area, rt, rtrs);
713 }
714 }