summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-01-11 19:42:28 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-01-11 19:42:28 +0000
commitfcc9cf7db4360a34e0734c6dbd2cfecbfc32fc50 (patch)
tree3594b526e4e2fbbe7b79256944cda80718877aee
parentbabbc9dfc44e7a7eb5f0854251a1f02a15c3d77c (diff)
when sending the nexthop status message, include the kroute that makes that
nexthop reachable. needed in the RDE for calculating the to-be-announced nexthop. ok claudio@
-rw-r--r--usr.sbin/bgpd/bgpd.h3
-rw-r--r--usr.sbin/bgpd/kroute.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 5a1fcc7db06..70f10248857 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.63 2004/01/11 19:14:43 henning Exp $ */
+/* $OpenBSD: bgpd.h,v 1.64 2004/01/11 19:42:27 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -208,6 +208,7 @@ struct kroute_nexthop {
u_int8_t valid;
u_int8_t connected;
struct bgpd_addr gateway;
+ struct kroute kr;
};
struct ctl_show_nexthop {
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c
index ec99b8bc6dc..4d21ac9af0e 100644
--- a/usr.sbin/bgpd/kroute.c
+++ b/usr.sbin/bgpd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.63 2004/01/11 19:14:43 henning Exp $ */
+/* $OpenBSD: kroute.c,v 1.64 2004/01/11 19:42:27 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -270,6 +270,7 @@ kr_nexthop_add(in_addr_t key)
nh.valid = 1;
nh.connected = h->kroute->r.flags & F_CONNECTED;
nh.gateway.v4.s_addr = h->kroute->r.nexthop;
+ memcpy(&nh.kr, &h->kroute->r, sizeof(nh.kr));
}
send_nexthop_update(&nh);
} else {
@@ -604,6 +605,7 @@ knexthop_validate(struct knexthop_node *kn)
n.valid = 1;
n.connected = kr->r.flags & F_CONNECTED;
n.gateway.v4.s_addr = kr->r.nexthop;
+ memcpy(&n.kr, &kr->r, sizeof(n.kr));
send_nexthop_update(&n);
}
}
@@ -763,6 +765,7 @@ if_change(u_short ifindex, int flags)
nh.gateway.v4.s_addr =
kkr->kr->r.nexthop;
}
+ memcpy(&nh.kr, &kkr->kr->r, sizeof(nh.kr));
send_nexthop_update(&nh);
}
}