int num_ifindex = 0;
struct stream *s;
uint16_t length;
- u_char marker;
- u_char version;
+ uint8_t marker;
+ uint8_t version;
vrf_id_t vrf_id;
uint16_t command = 0;
struct in_addr raddr;
tab_size, addr_str, pim->vrf->name);
return num_ifindex;
}
+ nexthop_tab[num_ifindex].protocol_distance = distance;
+ nexthop_tab[num_ifindex].route_metric = metric;
switch (nexthop_type) {
case NEXTHOP_TYPE_IFINDEX:
+ nexthop_tab[num_ifindex].ifindex = stream_getl(s);
+ /*
+ * Connected route (i.e. no nexthop), use
+ * address passed in as PIM nexthop. This will
+ * allow us to work in cases where we are
+ * trying to find a route for this box.
+ */
+ nexthop_tab[num_ifindex].nexthop_addr.family = AF_INET;
+ nexthop_tab[num_ifindex].nexthop_addr.prefixlen =
+ IPV4_MAX_BITLEN;
+ nexthop_tab[num_ifindex].nexthop_addr.u.prefix4 =
+ addr;
+ ++num_ifindex;
+ break;
case NEXTHOP_TYPE_IPV4_IFINDEX:
case NEXTHOP_TYPE_IPV4:
nexthop_tab[num_ifindex].nexthop_addr.family = AF_INET;
- if (nexthop_type == NEXTHOP_TYPE_IPV4_IFINDEX
- || nexthop_type == NEXTHOP_TYPE_IPV4) {
- nexthop_tab[num_ifindex]
- .nexthop_addr.u.prefix4.s_addr =
- stream_get_ipv4(s);
- } else {
- nexthop_tab[num_ifindex]
- .nexthop_addr.u.prefix4.s_addr =
- PIM_NET_INADDR_ANY;
- }
+ nexthop_tab[num_ifindex].nexthop_addr.u.prefix4.s_addr =
+ stream_get_ipv4(s);
nexthop_tab[num_ifindex].ifindex = stream_getl(s);
- nexthop_tab[num_ifindex].protocol_distance = distance;
- nexthop_tab[num_ifindex].route_metric = metric;
++num_ifindex;
break;
case NEXTHOP_TYPE_IPV6_IFINDEX:
uint32_t route_metric = 0xFFFFFFFF;
uint8_t protocol_distance = 0xFF;
- qpim_nexthop_lookups++;
+ pim->nexthop_lookups++;
for (lookup = 0; lookup < max_lookup; ++lookup) {
int num_ifindex;
nexthop_tab[0].route_metric);
}
- addr =
- nexthop_addr.u.prefix4; /* use nexthop addr for
- recursive lookup */
+ addr = nexthop_addr.u.prefix4; /* use nexthop addr for
+ recursive lookup */
} /* for (max_lookup) */
int err;
uint16_t length = 0;
vrf_id_t vrf_id;
- u_char marker;
- u_char version;
+ uint8_t marker;
+ uint8_t version;
stream_reset(s);
err = zclient_read_header(s, zlookup->sock, &length, &marker,