pim6d: implement/un-stub MRIB lookup

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2022-03-10 15:38:59 +01:00
parent 34ee41c6c9
commit dea337dc57
4 changed files with 13 additions and 22 deletions

View file

@ -37,22 +37,6 @@ void pim_nht_bsr_del(struct pim_instance *pim, struct in_addr addr)
{
}
int zclient_lookup_nexthop(struct pim_instance *pim,
struct pim_zlookup_nexthop nexthop_tab[],
const int tab_size, pim_addr addr,
int max_lookup)
{
return -1;
}
void zclient_lookup_new(void)
{
}
void zclient_lookup_free(void)
{
}
/*
* PIM register
*/

View file

@ -31,6 +31,8 @@ typedef struct in_addr pim_addr;
#define PIM_ADDRSTRLEN INET_ADDRSTRLEN
#define PIM_AF AF_INET
#define PIM_AFI AFI_IP
#define PIM_IPADDR IPADDR_V4
#define ipaddr_pim ipaddr_v4
#define PIM_MAX_BITLEN IPV4_MAX_BITLEN
#define PIM_AF_NAME "ip"
@ -52,6 +54,8 @@ typedef struct in6_addr pim_addr;
#define PIM_ADDRSTRLEN INET6_ADDRSTRLEN
#define PIM_AF AF_INET6
#define PIM_AFI AFI_IP6
#define PIM_IPADDR IPADDR_V6
#define ipaddr_pim ipaddr_v6
#define PIM_MAX_BITLEN IPV6_MAX_BITLEN
#define PIM_AF_NAME "ipv6"

View file

@ -199,11 +199,12 @@ static int zclient_read_nexthop(struct pim_instance *pim,
stream_get_ipaddr(s, &raddr);
if (raddr.ipa_type != IPADDR_V4 ||
raddr.ipaddr_v4.s_addr != addr.s_addr)
if (raddr.ipa_type != PIM_IPADDR ||
pim_addr_cmp(raddr.ipaddr_pim, addr)) {
zlog_warn("%s: address mismatch: addr=%pPA(%s) raddr=%pIA",
__func__, &addr, pim->vrf->name, &raddr);
/* warning only */
/* warning only */
}
distance = stream_getc(s);
metric = stream_getl(s);
@ -328,8 +329,8 @@ static int zclient_lookup_nexthop_once(struct pim_instance *pim,
return -1;
}
ipaddr.ipa_type = IPADDR_V4;
ipaddr.ipaddr_v4 = addr;
ipaddr.ipa_type = PIM_IPADDR;
ipaddr.ipaddr_pim = addr;
s = zlookup->obuf;
stream_reset(s);
@ -480,6 +481,7 @@ void pim_zlookup_show_ip_multicast(struct vty *vty)
}
}
#if PIM_IPV == 4
int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
{
struct stream *s = zlookup->obuf;
@ -568,3 +570,4 @@ int pim_zlookup_sg_statistics(struct channel_oil *c_oil)
return 0;
}
#endif

View file

@ -55,6 +55,7 @@ pim_common = \
pimd/pim_util.c \
pimd/pim_vty.c \
pimd/pim_zebra.c \
pimd/pim_zlookup.c \
pimd/pim_vxlan.c \
pimd/pimd.c \
# end
@ -75,7 +76,6 @@ pimd_pimd_SOURCES = \
pimd/pim_msdp_socket.c \
pimd/pim_register.c \
pimd/pim_signals.c \
pimd/pim_zlookup.c \
pimd/pim_zpthread.c \
pimd/pim_mroute_msg.c \
# end