summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/bgpd.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-26 00:14:05 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-26 00:14:05 +0000
commitef01dd9f7485bb065b90d3072b55347b6e03dffb (patch)
treed36d64420edfd1d83891ae769f397657edd69f37 /usr.sbin/bgpd/bgpd.c
parent29105c423c718cf455430c13c0b1185bea48edda (diff)
finally marry rde and kroute parts of the nexthop verification:
handle IMSG_NEXTHOP_ADD and send IMSG_NEXTHOP_UPDATE when appropriate
Diffstat (limited to 'usr.sbin/bgpd/bgpd.c')
-rw-r--r--usr.sbin/bgpd/bgpd.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index f065e021238..ac5b448380a 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.29 2003/12/25 17:07:24 henning Exp $ */
+/* $OpenBSD: bgpd.c,v 1.30 2003/12/26 00:14:04 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -320,6 +320,7 @@ dispatch_imsg(struct imsgbuf *ibuf, int idx, struct mrt_config *conf)
struct mrtdump_config *m;
ssize_t len;
int n;
+ in_addr_t ina;
if (imsg_get(ibuf, &imsg) > 0) {
switch (imsg.hdr.type) {
@@ -355,6 +356,19 @@ dispatch_imsg(struct imsgbuf *ibuf, int idx, struct mrt_config *conf)
if (kroute_delete(rfd, imsg.data))
fatal("kroute_delete error", errno);
break;
+ case IMSG_NEXTHOP_ADD:
+ if (idx != PFD_PIPE_ROUTE)
+ fatal("nexthop request not from RDE", 0);
+ memcpy(&ina, imsg.data, sizeof(ina));
+ kroute_nexthop_check(ina);
+ break;
+ case IMSG_NEXTHOP_REMOVE:
+ if (idx != PFD_PIPE_ROUTE)
+ fatal("nexthop request not from RDE", 0);
+ memcpy(&ina, imsg.data, sizeof(ina));
+ /* XXX */
+ /* kroute_nexthop_delete(ina); */
+ break;
default:
break;
}
@@ -363,3 +377,9 @@ dispatch_imsg(struct imsgbuf *ibuf, int idx, struct mrt_config *conf)
return (0);
}
+void
+send_nexthop_update(struct kroute_nexthop *msg)
+{
+ imsg_compose(&ibuf_rde, IMSG_NEXTHOP_UPDATE, 0,
+ msg, sizeof(struct kroute_nexthop));
+}