From 020709f9939c542e96b12f06522ad5e33d8cf445 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 4 Apr 2003 02:44:16 +0000 Subject: 2003-04-04 Paul Jakma * Sync to Zebra CVS * Fix lib/thread.h leak * Fix small Opaque LSA leak * Do not configure OSPF interfaces for secondary addresses * vtysh fixes from Hasso * Dave Watson's missing ntohs fix --- ospfd/ospf_lsa.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'ospfd/ospf_lsa.c') diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 45b554fb..9c81327e 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -1638,7 +1638,7 @@ ospf_install_flood_nssa (struct ospf *ospf, new2->data->type = OSPF_AS_NSSA_LSA; /* set P-bit if not ABR */ - if (! OSPF_IS_ABR) + if (! IS_OSPF_ABR (ospf)) { SET_FLAG(new2->data->options, OSPF_OPTION_NP); @@ -1799,12 +1799,11 @@ ospf_external_lsa_originate_timer (struct thread *thread) } struct external_info * -ospf_default_external_info () +ospf_default_external_info (struct ospf *ospf) { int type; struct route_node *rn; struct prefix_ipv4 p; - struct ospf *ospf = ospf_top; p.family = AF_INET; p.prefix.s_addr = 0; @@ -1834,8 +1833,10 @@ ospf_default_originate_timer (struct thread *thread) struct prefix_ipv4 p; struct in_addr nexthop; struct external_info *ei; - struct ospf *ospf = ospf_top; + struct ospf *ospf; + ospf = ospf_lookup (); + /* Get originate flags. */ origin = THREAD_ARG (thread); @@ -1851,7 +1852,7 @@ ospf_default_originate_timer (struct thread *thread) ospf_external_info_add (DEFAULT_ROUTE, p, 0, nexthop); } - if ((ei = ospf_default_external_info ())) + if ((ei = ospf_default_external_info (ospf))) ospf_external_lsa_originate (ospf, ei); return 0; @@ -1911,7 +1912,7 @@ ospf_external_lsa_refresh_default (struct ospf *ospf) p.prefixlen = 0; p.prefix.s_addr = 0; - ei = ospf_default_external_info (); + ei = ospf_default_external_info (ospf); lsa = ospf_external_info_find_lsa (ospf, &p); if (ei) @@ -2694,7 +2695,7 @@ ospf_lsa_lookup (struct ospf_area *area, u_int32_t type, #ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_AS_LSA: #endif /* HAVE_OPAQUE_LSA */ - return ospf_lsdb_lookup_by_id (ospf_top->lsdb, type, id, adv_router); + return ospf_lsdb_lookup_by_id (area->ospf->lsdb, type, id, adv_router); break; default: break; @@ -3117,7 +3118,9 @@ int ospf_lsa_action (struct thread *t) { struct lsa_action *data; - struct ospf *ospf = ospf_top; + struct ospf *ospf; + + ospf = ospf_lookup (); data = THREAD_ARG (t); -- cgit v1.2.1