summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/kroute.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2005-06-26 19:22:13 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2005-06-26 19:22:13 +0000
commit4fbf025e14c5bf2e91ab7bb75cb6c59f66c44f13 (patch)
tree41530c6fffb472c76b979e44da359822035c151f /usr.sbin/ospfd/kroute.c
parent27acceea3ddee7a247ff9a3ce6e9a0dce9aed224 (diff)
Do not automaticaly announce routes that have RTF_DYNAMIC set. These routes
are e.g. created by the PMTU code and are removed after some time. OK norby@
Diffstat (limited to 'usr.sbin/ospfd/kroute.c')
-rw-r--r--usr.sbin/ospfd/kroute.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c
index 67bd9850751..80916c1e179 100644
--- a/usr.sbin/ospfd/kroute.c
+++ b/usr.sbin/ospfd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.18 2005/05/24 21:36:40 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.19 2005/06/26 19:22:12 claudio Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -330,6 +330,10 @@ kr_redistribute(int type, struct kroute *kr)
{
u_int32_t a;
+ /* Dynamic routes are not redistributable. */
+ if (kr->flags & F_DYNAMIC)
+ return;
+
/*
* We consider the loopback net, multicast and experimental addresses
* as not redistributable.
@@ -780,6 +784,8 @@ fetchtable(void)
sa_in = (struct sockaddr_in *)rti_info[RTAX_NETMASK];
if (rtm->rtm_flags & RTF_STATIC)
kr->r.flags |= F_STATIC;
+ if (rtm->rtm_flags & RTF_DYNAMIC)
+ kr->r.flags |= F_DYNAMIC;
if (sa_in != NULL) {
if (sa_in->sin_len == 0)
break;
@@ -955,6 +961,8 @@ dispatch_rtmsg(void)
prefixlen_classful(prefix.s_addr);
if (rtm->rtm_flags & RTF_STATIC)
flags |= F_STATIC;
+ if (rtm->rtm_flags & RTF_DYNAMIC)
+ flags |= F_DYNAMIC;
break;
default:
continue;