From aa8017f87d42a1b7d74ebe04ffd8a7e3823fafd6 Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 19 Jul 2010 09:16:30 +0000 Subject: [PATCH] When removing an announced prefix inherit the metric and ext_tag from the LSA that is currently in the tree. Pruning with default metrics is bad since the checksum of the LSA is different and therefor an additional update cycle is needed to convince the other systems. OK bluhm@, sthen@ --- usr.sbin/ospfd/rde.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index 1dd96577f0a..0d7480cb07f 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.86 2010/07/01 21:19:57 bluhm Exp $ */ +/* $OpenBSD: rde.c,v 1.87 2010/07/19 09:16:30 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker @@ -1182,6 +1182,20 @@ orig_asext_lsa(struct rroute *rr, u_int16_t age) lsa->hdr.ls_id = rr->kr.prefix.s_addr; lsa->data.asext.mask = prefixlen2mask(rr->kr.prefixlen); + if (age == MAX_AGE) { + /* inherit metric and ext_tag from the current LSA, + * some routers don't like to get withdraws that are + * different from what they have in their table. + */ + struct vertex *v; + v = lsa_find(NULL, lsa->hdr.type, lsa->hdr.ls_id, + lsa->hdr.adv_rtr); + if (v != NULL) { + rr->metric = ntohl(v->lsa->data.asext.metric); + rr->kr.ext_tag = ntohl(v->lsa->data.asext.ext_tag); + } + } + /* * nexthop -- on connected routes we are the nexthop, * in other cases we may announce the true nexthop if the -- 2.20.1