diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-01-05 14:27:28 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-01-05 14:31:36 -0500 | 
| commit | 68ff69fa27180b7e662916f4c7d45f83f833d986 (patch) | |
| tree | 9700e67cb23280ec2b0c34285eb4f8cbc6ab149f /zebra/zebra_rib.c | |
| parent | 1cd8bd054c6eafdcda1f5b1626f89622d170f536 (diff) | |
zebra: Set metric appropriately on route offload to asic
When FRR receives a route from the kernel about the route
offload success/failure.  The metric being reported is not
going to be correct since we may not know it appropriately
at this point in time.  If we can set the metric to something
appropriate.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 03f2591cfe..73aa57c986 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2765,6 +2765,14 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)  			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 (RIB_SYSTEM_ROUTE(re)) {  		/* Notify dataplane */  | 
