Merge pull request #2386 from gromit1811/pim-connected-nexthop-fix2

pimd: Fix connected route nexthop fix from 66f5152f
This commit is contained in:
Donald Sharp 2018-06-08 13:50:48 -04:00 committed by GitHub
commit c0efc5989f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View File

@ -667,7 +667,7 @@ int pim_parse_nexthop_update(int command, struct zclient *zclient,
* RPF address from nexthop cache (i.e. * RPF address from nexthop cache (i.e.
* destination) as PIM nexthop. * destination) as PIM nexthop.
*/ */
nexthop->type = NEXTHOP_TYPE_IPV4; nexthop->type = NEXTHOP_TYPE_IPV4_IFINDEX;
nexthop->gate.ipv4 = nexthop->gate.ipv4 =
pnc->rpf.rpf_addr.u.prefix4; pnc->rpf.rpf_addr.u.prefix4;
break; break;

View File

@ -215,6 +215,8 @@ static int zclient_read_nexthop(struct pim_instance *pim,
tab_size, addr_str, pim->vrf->name); tab_size, addr_str, pim->vrf->name);
return num_ifindex; return num_ifindex;
} }
nexthop_tab[num_ifindex].protocol_distance = distance;
nexthop_tab[num_ifindex].route_metric = metric;
switch (nexthop_type) { switch (nexthop_type) {
case NEXTHOP_TYPE_IFINDEX: case NEXTHOP_TYPE_IFINDEX:
nexthop_tab[num_ifindex].ifindex = stream_getl(s); nexthop_tab[num_ifindex].ifindex = stream_getl(s);
@ -276,13 +278,19 @@ static int zclient_read_nexthop(struct pim_instance *pim,
} }
++num_ifindex; ++num_ifindex;
break; break;
case NEXTHOP_TYPE_IPV6: default:
case NEXTHOP_TYPE_BLACKHOLE: /* do nothing */
/* ignore */ {
continue; char addr_str[INET_ADDRSTRLEN];
pim_inet4_dump("<addr?>", addr, addr_str,
sizeof(addr_str));
zlog_warn(
"%s: found non-ifindex nexthop type=%d for address %s(%s)",
__PRETTY_FUNCTION__, nexthop_type,
addr_str, pim->vrf->name);
}
break;
} }
nexthop_tab[num_ifindex].protocol_distance = distance;
nexthop_tab[num_ifindex].route_metric = metric;
} }
return num_ifindex; return num_ifindex;