mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 11:15:47 +00:00
Merge pull request #12604 from donaldsharp/distance_metric_offload_fixes
Distance/metric offload fixes
This commit is contained in:
commit
bb1d52b3c0
@ -35,6 +35,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define ROUTE_INSTALLATION_METRIC 20
|
||||||
|
|
||||||
#define RKERNEL_ROUTE(type) ((type) == ZEBRA_ROUTE_KERNEL)
|
#define RKERNEL_ROUTE(type) ((type) == ZEBRA_ROUTE_KERNEL)
|
||||||
|
|
||||||
#define RSYSTEM_ROUTE(type) \
|
#define RSYSTEM_ROUTE(type) \
|
||||||
|
@ -2077,7 +2077,7 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
|
|||||||
* by the routing protocol and for communicating with protocol peers.
|
* by the routing protocol and for communicating with protocol peers.
|
||||||
*/
|
*/
|
||||||
if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY,
|
if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY,
|
||||||
NL_DEFAULT_ROUTE_METRIC))
|
ROUTE_INSTALLATION_METRIC))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if defined(SUPPORT_REALMS)
|
#if defined(SUPPORT_REALMS)
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NL_DEFAULT_ROUTE_METRIC 20
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Additional protocol strings to push into routes
|
* Additional protocol strings to push into routes
|
||||||
|
@ -2712,10 +2712,6 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)
|
|||||||
if (ere->src_p_provided)
|
if (ere->src_p_provided)
|
||||||
apply_mask_ipv6(&ere->src_p);
|
apply_mask_ipv6(&ere->src_p);
|
||||||
|
|
||||||
/* Set default distance by route type. */
|
|
||||||
if (re->distance == 0)
|
|
||||||
re->distance = route_distance(re->type);
|
|
||||||
|
|
||||||
/* Lookup route node.*/
|
/* Lookup route node.*/
|
||||||
rn = srcdest_rnode_get(table, &ere->p,
|
rn = srcdest_rnode_get(table, &ere->p,
|
||||||
ere->src_p_provided ? &ere->src_p : NULL);
|
ere->src_p_provided ? &ere->src_p : NULL);
|
||||||
@ -2762,6 +2758,22 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set default distance by route type. */
|
||||||
|
if (re->distance == 0) {
|
||||||
|
if (same && !zebra_router_notify_on_ack())
|
||||||
|
re->distance = same->distance;
|
||||||
|
else
|
||||||
|
re->distance = route_distance(re->type);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (re->metric == ROUTE_INSTALLATION_METRIC &&
|
||||||
|
CHECK_FLAG(re->flags, ZEBRA_FLAG_SELFROUTE)) {
|
||||||
|
if (same && !zebra_router_notify_on_ack())
|
||||||
|
re->metric = same->metric;
|
||||||
|
else
|
||||||
|
re->metric = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* If this route is kernel/connected route, notify the dataplane. */
|
/* If this route is kernel/connected route, notify the dataplane. */
|
||||||
if (RIB_SYSTEM_ROUTE(re)) {
|
if (RIB_SYSTEM_ROUTE(re)) {
|
||||||
/* Notify dataplane */
|
/* Notify dataplane */
|
||||||
|
Loading…
Reference in New Issue
Block a user