Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_fib_dxr.c
Show First 20 Lines • Show All 332 Lines • ▼ Show 20 Lines | initheap(struct dxr_aux *da, uint32_t dst_u32, uint32_t chunk) | ||||
struct rtentry *rt; | struct rtentry *rt; | ||||
struct route_nhop_data rnd; | struct route_nhop_data rnd; | ||||
da->heap_index = 0; | da->heap_index = 0; | ||||
da->dst.sin_addr.s_addr = htonl(dst_u32); | da->dst.sin_addr.s_addr = htonl(dst_u32); | ||||
rt = fib4_lookup_rt(da->fibnum, da->dst.sin_addr, 0, NHR_UNLOCKED, | rt = fib4_lookup_rt(da->fibnum, da->dst.sin_addr, 0, NHR_UNLOCKED, | ||||
&rnd); | &rnd); | ||||
if (rt != NULL) { | if (rt != NULL) { | ||||
/* FIXME check gw_sa.sa_family ? */ | |||||
melifaro: This code doesn't care about nexthop internals other than nhop index. | |||||
struct in_addr addr; | struct in_addr addr; | ||||
uint32_t scopeid; | uint32_t scopeid; | ||||
rt_get_inet_prefix_plen(rt, &addr, &fhp->preflen, &scopeid); | rt_get_inet_prefix_plen(rt, &addr, &fhp->preflen, &scopeid); | ||||
fhp->start = ntohl(addr.s_addr); | fhp->start = ntohl(addr.s_addr); | ||||
fhp->end = fhp->start; | fhp->end = fhp->start; | ||||
if (fhp->preflen < 32) | if (fhp->preflen < 32) | ||||
fhp->end |= (0xffffffffU >> fhp->preflen); | fhp->end |= (0xffffffffU >> fhp->preflen); | ||||
▲ Show 20 Lines • Show All 905 Lines • Show Last 20 Lines |
This code doesn't care about nexthop internals other than nhop index.