summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2004-09-08 16:18:12 +0000
committerhenning <henning@openbsd.org>2004-09-08 16:18:12 +0000
commitf3a7e6474bc62b7e2c855bda3e08b5c2d3aefa44 (patch)
tree3b8634ab48148aabc1fc2bf80809c36cc0aa0059
parentsecurity fix: (diff)
downloadwireguard-openbsd-f3a7e6474bc62b7e2c855bda3e08b5c2d3aefa44.tar.xz
wireguard-openbsd-f3a7e6474bc62b7e2c855bda3e08b5c2d3aefa44.zip
routed assumes it alone controls the routing table and tinkers with
routes it is not supposed to touch trying to aggregate them, which has unwanted effects when other routing daemons (bgpd) are running. note that bgpd behaves and only touches its own routes. workaround by ignoring routes with RTF_PROTO1 set, which bgpd sets for its routes. from a discussion with Arvid Grotting <arvidg@netfonds.no>, who tested a diff of same functionality (basically only formatting and comment different). ok deraadt
-rw-r--r--sbin/routed/routed.88
-rw-r--r--sbin/routed/table.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/sbin/routed/routed.8 b/sbin/routed/routed.8
index 14935ec7c1e..8d90344770a 100644
--- a/sbin/routed/routed.8
+++ b/sbin/routed/routed.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: routed.8,v 1.37 2003/08/08 09:34:10 jmc Exp $
+.\" $OpenBSD: routed.8,v 1.38 2004/09/08 16:18:12 henning Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -83,7 +83,11 @@ Soon after being first started, and provided there is at least one
interface on which RIP has not been disabled,
.Nm
deletes all pre-existing
-non-static routes in the kernel table.
+non-static routes in the kernel table,
+except those marked with the RTF_PROTO1 flag (see
+.Xr route 4 ) ,
+i.e. routes that have been inserted by
+.Xr bgpd 8 .
Static routes in the kernel table are preserved and
included in RIP responses if they have a valid RIP metric
(see
diff --git a/sbin/routed/table.c b/sbin/routed/table.c
index 82bbf1b0efc..c70578d9051 100644
--- a/sbin/routed/table.c
+++ b/sbin/routed/table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table.c,v 1.15 2004/04/25 15:50:35 markus Exp $ */
+/* $OpenBSD: table.c,v 1.16 2004/09/08 16:18:12 henning Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -1054,6 +1054,10 @@ read_rt(void)
continue;
}
+ /* ignore routes from bgpd */
+ if (m.r.rtm.rtm_flags & RTF_PROTO1)
+ continue;
+
if (m.r.rtm.rtm_type == RTM_IFINFO
|| m.r.rtm.rtm_type == RTM_NEWADDR
|| m.r.rtm.rtm_type == RTM_DELADDR) {