summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bgpd/bgpd.conf.54
-rw-r--r--usr.sbin/bgpd/bgpd.h5
-rw-r--r--usr.sbin/bgpd/config.c4
-rw-r--r--usr.sbin/bgpd/parse.y9
-rw-r--r--usr.sbin/bgpd/rde.c5
5 files changed, 21 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/bgpd.conf.5 b/usr.sbin/bgpd/bgpd.conf.5
index c983d99031b..bb56807b34b 100644
--- a/usr.sbin/bgpd/bgpd.conf.5
+++ b/usr.sbin/bgpd/bgpd.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bgpd.conf.5,v 1.2 2003/12/24 11:38:56 henning Exp $
+.\" $OpenBSD: bgpd.conf.5,v 1.3 2003/12/24 13:49:21 henning Exp $
.\"
.\" Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
.\" Copyright (c) 2002 Daniel Hartmeier <dhartmei@openbsd.org>
@@ -129,6 +129,8 @@ daemon should listen on.
.Bd -literal -offset indent
listen on 127.0.0.1
.Ed
+.It Ar no fib-update
+Do not update the Forward Information Base aka the kernel routing table.
.El
.Sh NEIGHBORS AND GROUPS
.Ar bgpd
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 0dbc1a49896..16a4c307887 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.15 2003/12/23 18:28:05 henning Exp $ */
+/* $OpenBSD: bgpd.h,v 1.16 2003/12/24 13:49:21 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -39,6 +39,8 @@
#define BGPD_OPT_VERBOSE2 0x0002
#define BGPD_OPT_NOACTION 0x0004
+#define BGPD_FLAG_NO_FIB_UPDATE 0x0001
+
enum {
PROC_MAIN,
PROC_SE,
@@ -99,6 +101,7 @@ struct bgpd_config {
u_int32_t bgpid;
u_int16_t holdtime;
u_int16_t min_holdtime;
+ int flags;
struct sockaddr_in listen_addr;
struct peer *peers;
};
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c
index dc2d26d0c2d..39a20243bad 100644
--- a/usr.sbin/bgpd/config.c
+++ b/usr.sbin/bgpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.3 2003/12/23 01:06:21 henning Exp $ */
+/* $OpenBSD: config.c,v 1.4 2003/12/24 13:49:21 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -70,6 +70,8 @@ merge_config(struct bgpd_config *xconf, struct bgpd_config *conf)
memcpy(&xconf->listen_addr, &conf->listen_addr,
sizeof(xconf->listen_addr));
+ xconf->flags = conf->flags;
+
/*
* as we cannot get the negotiated holdtime in the main process,
* the session engine needs to check it against the possibly new values
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 146cbfc9ab9..9dee3620158 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.10 2003/12/23 13:13:24 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.11 2003/12/24 13:49:21 henning Exp $ */
/*
* Copyright (c) 2002, 2003 Henning Brauer <henning@openbsd.org>
@@ -82,7 +82,7 @@ typedef struct {
%}
%token SET
-%token AS BGPID HOLDTIME YMIN LISTEN ON
+%token AS BGPID HOLDTIME YMIN LISTEN ON NO FIBUPDATE
%token GROUP NEIGHBOR
%token REMOTEAS DESCR LOCALADDR MULTIHOP
%token ERROR
@@ -155,6 +155,9 @@ conf_main : AS number {
| LISTEN ON address {
conf->listen_addr.sin_addr.s_addr = $3.s_addr;
}
+ | NO FIBUPDATE {
+ conf->flags |= BGPD_FLAG_NO_FIB_UPDATE;
+ }
/*
* XXX this is bad.
* a) number should be optional
@@ -301,6 +304,7 @@ lookup(char *s)
{ "AS", AS},
{ "bgpid", BGPID},
{ "descr", DESCR},
+ { "fib-update", FIBUPDATE},
{ "group", GROUP},
{ "holdtime", HOLDTIME},
{ "listen", LISTEN},
@@ -309,6 +313,7 @@ lookup(char *s)
{ "mrtdump", MRTDUMP},
{ "multihop", MULTIHOP},
{ "neighbor", NEIGHBOR},
+ { "no", NO},
{ "on", ON},
{ "remote-as", REMOTEAS},
{ "set", SET},
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 16af16b34e0..0aa56bd147c 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.24 2003/12/24 13:28:02 henning Exp $ */
+/* $OpenBSD: rde.c,v 1.25 2003/12/24 13:49:21 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -516,6 +516,9 @@ rde_send_kroute(struct prefix *new, struct prefix *old)
struct prefix *p;
enum imsg_type type;
+ if (conf->flags & BGPD_FLAG_NO_FIB_UPDATE)
+ return;
+
if (old == NULL && new == NULL)
return;