summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospf6d/interface.c6
-rw-r--r--usr.sbin/ospf6d/rde.c18
2 files changed, 22 insertions, 2 deletions
diff --git a/usr.sbin/ospf6d/interface.c b/usr.sbin/ospf6d/interface.c
index 9d58b26fd2c..5f231ad3410 100644
--- a/usr.sbin/ospf6d/interface.c
+++ b/usr.sbin/ospf6d/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.11 2009/01/29 19:07:53 stsp Exp $ */
+/* $OpenBSD: interface.c,v 1.12 2009/02/19 22:05:32 stsp Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -143,6 +143,10 @@ if_fsm(struct iface *iface, enum iface_event event)
orig_rtr_lsa(iface);
orig_link_lsa(iface);
orig_intra_lsa_rtr(iface);
+
+ /* state change inform RDE */
+ ospfe_imsg_compose_rde(IMSG_IFINFO,
+ iface->self->peerid, 0, iface, sizeof(struct iface));
}
if (old_state & (IF_STA_MULTI | IF_STA_POINTTOPOINT) &&
diff --git a/usr.sbin/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c
index bdda1ca0bb5..bd801e00191 100644
--- a/usr.sbin/ospf6d/rde.c
+++ b/usr.sbin/ospf6d/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.20 2009/02/10 17:32:58 stsp Exp $ */
+/* $OpenBSD: rde.c,v 1.21 2009/02/19 22:05:32 stsp Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -242,6 +242,7 @@ rde_dispatch_imsg(int fd, short event, void *bula)
struct lsa *lsa;
struct area *area;
struct vertex *v;
+ struct iface *iface, *ifp;
char *buf;
ssize_t n;
time_t now;
@@ -565,6 +566,21 @@ rde_dispatch_imsg(int fd, short event, void *bula)
imsg_compose(ibuf_ospfe, IMSG_CTL_END, 0, imsg.hdr.pid,
NULL, 0);
break;
+ case IMSG_IFINFO:
+ if (imsg.hdr.len != IMSG_HEADER_SIZE +
+ sizeof(struct iface))
+ fatalx("IFINFO imsg with wrong len");
+
+ ifp = imsg.data;
+
+ iface = if_find(ifp->ifindex);
+ if (iface == NULL)
+ fatalx("interface lost in rde");
+ iface->flags = ifp->flags;
+ iface->linkstate = ifp->linkstate;
+ iface->nh_reachable = ifp->nh_reachable;
+ iface->state = ifp->state;
+ break;
default:
log_debug("rde_dispatch_imsg: unexpected imsg %d",
imsg.hdr.type);