diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 15:59:56 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2016-05-23 15:59:56 +0000 |
commit | f10b2a25b3d9bf662a4a1814f0e24eb9baef2701 (patch) | |
tree | f2915d5673a14ed251b9b1d6ba19f173a8ea87ab /usr.sbin/ldpd | |
parent | a6fe096f2bfa76855f4460d979db2342b28cd9ef (diff) |
Fix issue with the exponential backoff timer.
Do not start the exponential backoff timer when playing the passive role
of the session establishment process.
RFC 5036 - Section 2.5.3 says:
"The specific session establishment action that must be
delayed is the attempt to open the session transport connection by
the LSR playing the active role".
Diffstat (limited to 'usr.sbin/ldpd')
-rw-r--r-- | usr.sbin/ldpd/init.c | 5 | ||||
-rw-r--r-- | usr.sbin/ldpd/neighbor.c | 7 | ||||
-rw-r--r-- | usr.sbin/ldpd/notification.c | 5 |
3 files changed, 7 insertions, 10 deletions
diff --git a/usr.sbin/ldpd/init.c b/usr.sbin/ldpd/init.c index dd366f5267c..c62e5c581d5 100644 --- a/usr.sbin/ldpd/init.c +++ b/usr.sbin/ldpd/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.18 2016/05/23 15:43:11 renato Exp $ */ +/* $OpenBSD: init.c,v 1.19 2016/05/23 15:59:55 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -109,8 +109,7 @@ recv_init(struct nbr *nbr, char *buf, u_int16_t len) nbr->keepalive = min(nbr_get_keepalive(nbr->raddr), ntohs(sess.keepalive_time)); - if (!nbr_pending_idtimer(nbr)) - nbr_fsm(nbr, NBR_EVT_INIT_RCVD); + nbr_fsm(nbr, NBR_EVT_INIT_RCVD); return (ntohs(init.length)); } diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c index 566cefc57bb..e49373166c8 100644 --- a/usr.sbin/ldpd/neighbor.c +++ b/usr.sbin/ldpd/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.58 2016/05/23 15:57:50 renato Exp $ */ +/* $OpenBSD: neighbor.c,v 1.59 2016/05/23 15:59:55 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -386,10 +386,7 @@ nbr_idtimer(int fd, short event, void *arg) log_debug("%s: neighbor ID %s", __func__, inet_ntoa(nbr->id)); - if (nbr_session_active_role(nbr)) - nbr_establish_connection(nbr); - else if (nbr->state == NBR_STA_INITIAL) - nbr_fsm(nbr, NBR_EVT_INIT_RCVD); + nbr_establish_connection(nbr); } void diff --git a/usr.sbin/ldpd/notification.c b/usr.sbin/ldpd/notification.c index cc0c7ac8dba..0e42ea53c21 100644 --- a/usr.sbin/ldpd/notification.c +++ b/usr.sbin/ldpd/notification.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notification.c,v 1.19 2016/05/23 15:14:08 renato Exp $ */ +/* $OpenBSD: notification.c,v 1.20 2016/05/23 15:59:55 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -223,11 +223,12 @@ recv_notification(struct nbr *nbr, char *buf, u_int16_t len) notification_name(ntohl(st.status_code))); if (st.status_code & htonl(STATUS_FATAL)) { - if (st.status_code == htonl(S_NO_HELLO) || + if ((st.status_code == htonl(S_NO_HELLO) || st.status_code == htonl(S_PARM_ADV_MODE) || st.status_code == htonl(S_MAX_PDU_LEN) || st.status_code == htonl(S_PARM_L_RANGE) || st.status_code == htonl(S_KEEPALIVE_BAD)) + && nbr_session_active_role(nbr)) nbr_start_idtimer(nbr); nbr_fsm(nbr, NBR_EVT_CLOSE_SESSION); |