From 4a15265f6d5eefabf7b40921fc4ba96b44481ebc Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Fri, 9 Jan 2004 14:10:07 +0000 Subject: flag kernel routes whch are not conencted routes as static routes. that's what they are, and it makes matching on them easier. --- usr.sbin/bgpd/bgpd.h | 13 +++++++------ usr.sbin/bgpd/kroute.c | 5 ++++- 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 @@ -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 @@ -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) -- cgit v1.2.3