zebra: Fix broken rib_match

rib_match is broken because the prefix is being
treated as a char * pointer instead of the
correct data type.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 8b5d6c95781b7c55faa957a2d3edf00c1ecb5c5a)
This commit is contained in:
Donald Sharp 2016-09-14 15:17:50 -04:00
parent 10fbd59a57
commit d71f1c4e6f

View File

@ -764,12 +764,16 @@ rib_match (afi_t afi, safi_t safi, vrf_id_t vrf_id,
memset (&p, 0, sizeof (struct prefix));
p.family = afi;
p.u.prefix = *(u_char *)addr;
p.prefixlen = IPV4_MAX_PREFIXLEN;
if (afi == AFI_IP)
p.prefixlen = IPV4_MAX_PREFIXLEN;
{
p.u.prefix4 = addr->ipv4;
p.prefixlen = IPV4_MAX_PREFIXLEN;
}
else
p.prefixlen = IPV6_MAX_PREFIXLEN;
{
p.u.prefix6 = addr->ipv6;
p.prefixlen = IPV6_MAX_PREFIXLEN;
}
rn = route_node_match (table, (struct prefix *) &p);