mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:33:15 +00:00
ldpd: allow targeted neighbors over any interface
It's doesn't make sense to enforce that a targeted-hello is received on an LDP-enabled interface. It should be possible, for example, to use LDP only to signal pseudowires and other another protocol (e.g. RSVP-TE) to create end-to-end LSPs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
abb1600611
commit
cb7426d403
@ -27,7 +27,7 @@
|
|||||||
#include "sockopt.h"
|
#include "sockopt.h"
|
||||||
|
|
||||||
static struct iface *disc_find_iface(unsigned int, int,
|
static struct iface *disc_find_iface(unsigned int, int,
|
||||||
union ldpd_addr *, int);
|
union ldpd_addr *);
|
||||||
static int session_read(struct thread *);
|
static int session_read(struct thread *);
|
||||||
static int session_write(struct thread *);
|
static int session_write(struct thread *);
|
||||||
static ssize_t session_get_pdu(struct ibuf_read *, char **);
|
static ssize_t session_get_pdu(struct ibuf_read *, char **);
|
||||||
@ -134,7 +134,7 @@ disc_recv_packet(struct thread *thread)
|
|||||||
int af;
|
int af;
|
||||||
union ldpd_addr src;
|
union ldpd_addr src;
|
||||||
unsigned int ifindex = 0;
|
unsigned int ifindex = 0;
|
||||||
struct iface *iface;
|
struct iface *iface = NULL;
|
||||||
uint16_t len;
|
uint16_t len;
|
||||||
struct ldp_hdr ldp_hdr;
|
struct ldp_hdr ldp_hdr;
|
||||||
uint16_t pdu_len;
|
uint16_t pdu_len;
|
||||||
@ -212,9 +212,11 @@ disc_recv_packet(struct thread *thread)
|
|||||||
ifindex = getsockopt_ifindex(af, &m);
|
ifindex = getsockopt_ifindex(af, &m);
|
||||||
|
|
||||||
/* find a matching interface */
|
/* find a matching interface */
|
||||||
iface = disc_find_iface(ifindex, af, &src, multicast);
|
if (multicast) {
|
||||||
if (iface == NULL)
|
iface = disc_find_iface(ifindex, af, &src);
|
||||||
return (0);
|
if (iface == NULL)
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
/* check packet size */
|
/* check packet size */
|
||||||
len = (uint16_t)r;
|
len = (uint16_t)r;
|
||||||
@ -280,8 +282,7 @@ disc_recv_packet(struct thread *thread)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct iface *
|
static struct iface *
|
||||||
disc_find_iface(unsigned int ifindex, int af, union ldpd_addr *src,
|
disc_find_iface(unsigned int ifindex, int af, union ldpd_addr *src)
|
||||||
int multicast)
|
|
||||||
{
|
{
|
||||||
struct iface *iface;
|
struct iface *iface;
|
||||||
struct iface_af *ia;
|
struct iface_af *ia;
|
||||||
@ -299,7 +300,7 @@ disc_find_iface(unsigned int ifindex, int af, union ldpd_addr *src,
|
|||||||
* "Link-local IPv6 address MUST be used as the source IP address in
|
* "Link-local IPv6 address MUST be used as the source IP address in
|
||||||
* IPv6 LDP Link Hellos".
|
* IPv6 LDP Link Hellos".
|
||||||
*/
|
*/
|
||||||
if (multicast && af == AF_INET6 && !IN6_IS_ADDR_LINKLOCAL(&src->v6))
|
if (af == AF_INET6 && !IN6_IS_ADDR_LINKLOCAL(&src->v6))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
return (iface);
|
return (iface);
|
||||||
|
Loading…
Reference in New Issue
Block a user