From d71f1c4e6f97a6bb1250a962c1e875e6d65a6c93 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 14 Sep 2016 15:17:50 -0400 Subject: [PATCH] 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 (cherry picked from commit 8b5d6c95781b7c55faa957a2d3edf00c1ecb5c5a) --- zebra/zebra_rib.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 3812101431..1378d008ca 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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); -- 2.39.5