summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ldpd/address.c6
-rw-r--r--usr.sbin/ldpd/labelmapping.c7
-rw-r--r--usr.sbin/ldpd/ldpd.h3
-rw-r--r--usr.sbin/ldpd/neighbor.c4
-rw-r--r--usr.sbin/ldpd/notification.c3
5 files changed, 18 insertions, 5 deletions
diff --git a/usr.sbin/ldpd/address.c b/usr.sbin/ldpd/address.c
index 1f9e18c8397..901b76c5c9f 100644
--- a/usr.sbin/ldpd/address.c
+++ b/usr.sbin/ldpd/address.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: address.c,v 1.9 2013/06/01 19:01:32 claudio Exp $ */
+/* $OpenBSD: address.c,v 1.10 2013/06/01 19:42:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -75,6 +75,7 @@ send_address(struct nbr *nbr, struct iface *iface)
gen_address_list_tlv(buf, iface, size);
evbuf_enqueue(&nbr->wbuf, buf);
+ nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}
int
@@ -134,6 +135,8 @@ recv_address(struct nbr *nbr, char *buf, u_int16_t len)
return (-1);
}
+ nbr_fsm(nbr, NBR_EVT_PDU_RCVD);
+
return (ntohs(addr.length));
}
@@ -186,4 +189,5 @@ send_address_withdraw(struct nbr *nbr, struct iface *iface)
gen_address_list_tlv(buf, iface, size);
evbuf_enqueue(&nbr->wbuf, buf);
+ nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c
index 268e44b88da..f4fd3566f25 100644
--- a/usr.sbin/ldpd/labelmapping.c
+++ b/usr.sbin/ldpd/labelmapping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: labelmapping.c,v 1.22 2013/06/01 19:01:32 claudio Exp $ */
+/* $OpenBSD: labelmapping.c,v 1.23 2013/06/01 19:42:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -84,6 +84,7 @@ send_labelmapping(struct nbr *nbr)
ldp_hdr->length = htons(size);
evbuf_enqueue(&nbr->wbuf, buf);
+ nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}
int
@@ -184,6 +185,7 @@ send_labelrequest(struct nbr *nbr)
ldp_hdr->length = htons(size);
evbuf_enqueue(&nbr->wbuf, buf);
+ nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}
int
@@ -280,6 +282,7 @@ send_labelwithdraw(struct nbr *nbr)
ldp_hdr->length = htons(size);
evbuf_enqueue(&nbr->wbuf, buf);
+ nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}
int
@@ -412,6 +415,7 @@ send_labelrelease(struct nbr *nbr)
ldp_hdr->length = htons(size);
evbuf_enqueue(&nbr->wbuf, buf);
+ nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}
int
@@ -522,6 +526,7 @@ send_labelabortreq(struct nbr *nbr)
gen_msg_tlv(buf, MSG_TYPE_LABELABORTREQ, size);
evbuf_enqueue(&nbr->wbuf, buf);
+ nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}
int
diff --git a/usr.sbin/ldpd/ldpd.h b/usr.sbin/ldpd/ldpd.h
index 9fafcf2be02..c111b209eea 100644
--- a/usr.sbin/ldpd/ldpd.h
+++ b/usr.sbin/ldpd/ldpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.h,v 1.35 2013/06/01 19:28:55 claudio Exp $ */
+/* $OpenBSD: ldpd.h,v 1.36 2013/06/01 19:42:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -154,6 +154,7 @@ enum nbr_event {
NBR_EVT_INIT_RCVD,
NBR_EVT_KEEPALIVE_RCVD,
NBR_EVT_PDU_RCVD,
+ NBR_EVT_PDU_SENT,
NBR_EVT_INIT_SENT,
NBR_EVT_DOWN
};
diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c
index cb0a70409f4..131a06831c6 100644
--- a/usr.sbin/ldpd/neighbor.c
+++ b/usr.sbin/ldpd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.32 2013/06/01 19:28:55 claudio Exp $ */
+/* $OpenBSD: neighbor.c,v 1.33 2013/06/01 19:42:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -104,6 +104,7 @@ struct {
{NBR_STA_OPENSENT, NBR_EVT_INIT_RCVD, NBR_ACT_KEEPALIVE_SEND, NBR_STA_OPENREC},
/* Session Maintenance */
{NBR_STA_OPER, NBR_EVT_PDU_RCVD, NBR_ACT_RST_KTIMEOUT, 0},
+ {NBR_STA_OPER, NBR_EVT_PDU_SENT, NBR_ACT_RST_KTIMER, 0},
/* Session Close */
{NBR_STA_SESSION, NBR_EVT_CLOSE_SESSION, NBR_ACT_CLOSE_SESSION, NBR_STA_PRESENT},
{NBR_STA_SESSION, NBR_EVT_DOWN, NBR_ACT_CLOSE_SESSION, },
@@ -118,6 +119,7 @@ const char * const nbr_event_names[] = {
"INIT RECEIVED",
"KEEPALIVE RECEIVED",
"PDU RECEIVED",
+ "PDU SENT",
"INIT SENT",
"DOWN"
};
diff --git a/usr.sbin/ldpd/notification.c b/usr.sbin/ldpd/notification.c
index 2cf419f5a60..580167e5568 100644
--- a/usr.sbin/ldpd/notification.c
+++ b/usr.sbin/ldpd/notification.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: notification.c,v 1.11 2013/06/01 18:47:07 claudio Exp $ */
+/* $OpenBSD: notification.c,v 1.12 2013/06/01 19:42:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -47,6 +47,7 @@ send_notification_nbr(struct nbr *nbr, u_int32_t status, u_int32_t msgid,
buf = send_notification(status, msgid, type);
evbuf_enqueue(&nbr->wbuf, buf);
+ nbr_fsm(nbr, NBR_EVT_PDU_SENT);
}
struct ibuf *