summaryrefslogtreecommitdiff
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
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@
-rw-r--r--usr.sbin/ospfd/kroute.c10
-rw-r--r--usr.sbin/ospfd/ospfd.h5
2 files changed, 12 insertions, 3 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;
diff --git a/usr.sbin/ospfd/ospfd.h b/usr.sbin/ospfd/ospfd.h
index 4ac2521d597..09718b3a11b 100644
--- a/usr.sbin/ospfd/ospfd.h
+++ b/usr.sbin/ospfd/ospfd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.h,v 1.34 2005/05/27 02:07:13 norby Exp $ */
+/* $OpenBSD: ospfd.h,v 1.35 2005/06/26 19:22:12 claudio Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -51,7 +51,8 @@
#define F_CONNECTED 0x0004
#define F_DOWN 0x0010
#define F_STATIC 0x0020
-#define F_LONGER 0x0040
+#define F_DYNAMIC 0x0040
+#define F_LONGER 0x0080
#define REDISTRIBUTE_STATIC 0x01
#define REDISTRIBUTE_CONNECTED 0x02