Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/nhgrp.c
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
/* | /* | ||||
* In case of consistent hashing, there can be multiple nexthop groups | * In case of consistent hashing, there can be multiple nexthop groups | ||||
* with the same "control plane" list of nexthops with weights and a | * with the same "control plane" list of nexthops with weights and a | ||||
* different set of "data plane" nexthops. | * different set of "data plane" nexthops. | ||||
* For now, ignore the data plane and focus on the control plane list. | * For now, ignore the data plane and focus on the control plane list. | ||||
*/ | */ | ||||
if (a->nhg_nh_count != b->nhg_nh_count) | if (a->nhg_nh_count != b->nhg_nh_count || a->nhg_uidx != b->nhg_uidx) | ||||
return (0); | return (0); | ||||
return !memcmp(a->nhg_nh_weights, b->nhg_nh_weights, | return !memcmp(a->nhg_nh_weights, b->nhg_nh_weights, | ||||
sizeof(struct weightened_nhop) * a->nhg_nh_count); | sizeof(struct weightened_nhop) * a->nhg_nh_count); | ||||
} | } | ||||
/* | /* | ||||
* Hash callback: calculate hash of an object | * Hash callback: calculate hash of an object | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 225 Lines • Show Last 20 Lines |