summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bgpd/bgpd.h13
-rw-r--r--usr.sbin/bgpd/kroute.c5
2 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index dcbbb74d2da..c3b7b9a8c7b 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.59 2004/01/09 13:47:07 henning Exp $ */
+/* $OpenBSD: bgpd.h,v 1.60 2004/01/09 14:10:06 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -48,11 +48,12 @@
#define SOCKET_NAME "/var/run/bgpd.sock"
-#define F_BGPD_INSERTED 0x0001
-#define F_KERNEL 0x0002
-#define F_CONNECTED 0x0004
-#define F_NEXTHOP 0x0008
-#define F_DOWN 0x0010
+#define F_BGPD_INSERTED 0x01
+#define F_KERNEL 0x02
+#define F_CONNECTED 0x04
+#define F_NEXTHOP 0x08
+#define F_DOWN 0x10
+#define F_STATIC 0x20
enum {
PROC_MAIN,
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index 4ed39d2bd1d..1498d83b3d2 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.59 2004/01/09 13:47:07 henning Exp $ */
+/* $OpenBSD: kroute.c,v 1.60 2004/01/09 14:10:06 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -368,6 +368,9 @@ kroute_insert(struct kroute_node *kr)
}
if (kr->r.flags & F_KERNEL) {
+ if (!(kr->r.flags & F_CONNECTED))
+ kr->r.flags |= F_STATIC;
+
mask = 0xffffffff << (32 - kr->r.prefixlen);
ina = ntohl(kr->r.prefix);
RB_FOREACH(h, knexthop_tree, &knt)