summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2011-12-06 14:46:42 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2012-01-02 17:15:09 +0400
commit4fafd3deef6eecab229e8b35189ffbc1f1ce9806 (patch)
treec9d566aacaa7da44c5189343872c91e19bc80411
parentc17fbd6b1eb38e71aba65c593fa41f2e54f0b896 (diff)
ospfd: avoid redundant lookup in ospf_redistribute_withdraw
The old algorithim looked up every node twice as it withdrew the entry. It looks up entry once in redistribute_withdraw, then looks it up again info_delete. Use result of first lookup to do the free directly. This may explain the slow performance observed in https://bugzilla.vyatta.com/show_bug.cgi?id=4421
-rw-r--r--ospfd/ospf_asbr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index 6f1b0b06..9d2aedb2 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -285,6 +285,9 @@ ospf_redistribute_withdraw (struct ospf *ospf, u_char type)
continue;
ospf_external_lsa_flush (ospf, type, &ei->p,
ei->ifindex /*, ei->nexthop */);
- ospf_external_info_delete (type, ei->p);
+
+ ospf_external_info_free (ei);
+ route_unlock_node (rn);
+ rn->info = NULL;
}
}