X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ldpd%2Fhello.c;h=d17e80008e0d211557efb497913e1dfc47b0502d;hb=a8a4fa8954fd3b4e5b4f9bc9173eef79a827a8ff;hp=95be1d51113cab047f824d69243d921c3183daac;hpb=d306e8c3c0a4bfd1d97d485a43614c3ddaf90937;p=mirror_frr.git diff --git a/ldpd/hello.c b/ldpd/hello.c index 95be1d511..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)) @@ -265,9 +266,15 @@ recv_hello(struct in_addr lsr_id, struct ldp_msg *msg, int af, } if (!tnbr) { - if (!((flags & F_HELLO_REQ_TARG) && - ((ldp_af_conf_get(leconf, af))->flags & - F_LDPD_AF_THELLO_ACCEPT))) + struct ldpd_af_conf *af_conf; + + if (!(flags & F_HELLO_REQ_TARG)) + return; + af_conf = ldp_af_conf_get(leconf, af); + if (!(af_conf->flags & F_LDPD_AF_THELLO_ACCEPT)) + return; + if (ldpe_acl_check(af_conf->acl_thello_accept_from, af, + src, (af == AF_INET) ? 32 : 128) != FILTER_PERMIT) return; tnbr = tnbr_new(af, src); @@ -285,11 +292,21 @@ recv_hello(struct in_addr lsr_id, struct ldp_msg *msg, int af, source.link.src_addr = *src; } - adj = adj_find(&source); + 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: @@ -367,6 +384,7 @@ recv_hello(struct in_addr lsr_id, struct ldp_msg *msg, int af, RB_INSERT(nbr_adj_head, &nbr->adj_tree, adj); } } + adj->ds_tlv = ds_tlv; /* * If the hello adjacency's address-family doesn't match the local @@ -413,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);