diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-06-13 15:32:24 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-06-13 18:21:16 +0200 |
commit | 0e3451e5cf761d877f5b99f8ac8acad0236dd4ab (patch) | |
tree | 2893106ff1b503e5a263ea3f0f11519c6a3e4b24 /ldpd/hello.c | |
parent | Merge pull request #681 (ASAN warnings) (diff) | |
download | frr-0e3451e5cf761d877f5b99f8ac8acad0236dd4ab.tar.xz frr-0e3451e5cf761d877f5b99f8ac8acad0236dd4ab.zip |
ldpd: fix issues with dual-stack adjacencies
Handling configuration changes from single-stack mode to dual-stack mode
(and vice-versa) is tricky. This patch attempts to solve all issues that
might happen on such circumstances.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r-- | ldpd/hello.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ldpd/hello.c b/ldpd/hello.c index dd67f68f7..d17e80008 100644 --- a/ldpd/hello.c +++ b/ldpd/hello.c @@ -214,6 +214,7 @@ recv_hello(struct in_addr lsr_id, struct ldp_msg *msg, int af, __func__, inet_ntoa(lsr_id)); return; } + ds_tlv = (tlvs_rcvd & F_HELLO_TLV_RCVD_DS) ? 1 : 0; /* implicit transport address */ if (!(tlvs_rcvd & F_HELLO_TLV_RCVD_ADDR)) @@ -291,11 +292,21 @@ recv_hello(struct in_addr lsr_id, struct ldp_msg *msg, int af, source.link.src_addr = *src; } + debug_hello_recv("%s lsr-id %s transport-address %s holdtime %u%s", + log_hello_src(&source), inet_ntoa(lsr_id), log_addr(af, &trans_addr), + holdtime, (ds_tlv) ? " (dual stack TLV present)" : ""); + adj = adj_find(lsr_id, &source); + if (adj && adj->ds_tlv != ds_tlv) { + /* + * Transient condition, ignore packet and wait until adjacency + * times out. + */ + return; + } nbr = nbr_find_ldpid(lsr_id.s_addr); /* check dual-stack tlv */ - ds_tlv = (tlvs_rcvd & F_HELLO_TLV_RCVD_DS) ? 1 : 0; if (ds_tlv && trans_pref != leconf->trans_pref) { /* * RFC 7552 - Section 6.1.1: @@ -420,10 +431,6 @@ recv_hello(struct in_addr lsr_id, struct ldp_msg *msg, int af, else adj_stop_itimer(adj); - debug_hello_recv("%s lsr-id %s transport-address %s holdtime %u%s", - log_hello_src(&source), inet_ntoa(lsr_id), log_addr(af, &trans_addr), - holdtime, (ds_tlv) ? " (dual stack TLV present)" : ""); - if (nbr && nbr->state == NBR_STA_PRESENT && !nbr_pending_idtimer(nbr) && nbr_session_active_role(nbr) && !nbr_pending_connect(nbr)) nbr_establish_connection(nbr); |