summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/kroute.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2005-04-18 11:07:56 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2005-04-18 11:07:56 +0000
commit2d2e1ae81e8abca6a3ca390eb69ad6b0c7bf9b78 (patch)
tree36a88bef6761dbd4792b1d078cf7edd4a715b475 /usr.sbin/bgpd/kroute.c
parentee0c70c0cbf84d4d747a799afb2c6e0a5cd1fb9a (diff)
Set flag F_STATIC based on RTF_STATIC and not just because the route came
from the kernel. That's what F_KERNEL is for. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/kroute.c')
-rw-r--r--usr.sbin/bgpd/kroute.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index 504d7145288..2680803b888 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.122 2005/04/08 00:07:18 henning Exp $ */
+/* $OpenBSD: kroute.c,v 1.123 2005/04/18 11:07:55 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -534,9 +534,6 @@ kroute_insert(struct kroute_node *kr)
}
if (kr->r.flags & F_KERNEL) {
- if (!(kr->r.flags & F_CONNECTED))
- kr->r.flags |= F_STATIC;
-
mask = prefixlen2mask(kr->r.prefixlen);
ina = ntohl(kr->r.prefix.s_addr);
RB_FOREACH(h, knexthop_tree, &knt)
@@ -1218,6 +1215,8 @@ fetchtable(void)
kr->r.prefix.s_addr =
((struct sockaddr_in *)sa)->sin_addr.s_addr;
sa_in = (struct sockaddr_in *)rti_info[RTAX_NETMASK];
+ if (rtm->rtm_flags & RTF_STATIC)
+ kr->r.flags |= F_STATIC;
if (sa_in != NULL) {
if (sa_in->sin_len == 0)
break;
@@ -1374,6 +1373,8 @@ dispatch_rtmsg(void)
((struct sockaddr_in *)sa)->sin_addr.s_addr;
sa_in = (struct sockaddr_in *)
rti_info[RTAX_NETMASK];
+ if (rtm->rtm_flags & RTF_STATIC)
+ flags |= F_STATIC;
if (sa_in != NULL) {
if (sa_in->sin_len != 0)
prefixlen = mask2prefixlen(