summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2009-02-19 22:05:33 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2009-02-19 22:05:33 +0000
commit73f37df46eaa0ea604ad4b015b998ba6d2581315 (patch)
tree62257122c6ea94e4343f1626fc3c08869ed72d34
parent93d9528bcad68f474804bb8619933f4c9d5f2dbe (diff)
Sync iface fsm state from ospfe to rde.
Also syncs other fields the ospfe is syncing to when getting iface updates from parent process. None of these fields are used by the rde yet, but state will be important soon, for proper origination of Intra-Area-Prefix LSAs. ok claudio@
-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);