[posix] deprioritize the added external routes (#7223)

The current priority of the added routes too high so it may get
preferred over routes learned from RA. Hence we increase the metric to
deprioritize the added routes.
This commit is contained in:
whd
2021-12-07 16:05:26 -08:00
committed by GitHub
parent 3c01127770
commit 270dc21875
+5 -2
View File
@@ -170,11 +170,14 @@
/**
* @def OPENTHREAD_POSIX_CONFIG_EXTERNAL_ROUTE_PRIORITY
*
* This macro defines the priority of external routes added to kernel.
* This macro defines the priority of external routes added to kernel. The larger the number, the lower the priority. We
* need to assign a low priority to such routes so that kernel prefers the infra link rather than thread. Otherwise we
* may unnecessarily transmit packets via thread, which potentially causes performance issue. In linux, normally infra
* link routes' metric value is not greater than 1024, hence 65535 should be big enough.
*
*/
#ifndef OPENTHREAD_POSIX_CONFIG_EXTERNAL_ROUTE_PRIORITY
#define OPENTHREAD_POSIX_CONFIG_EXTERNAL_ROUTE_PRIORITY 512
#define OPENTHREAD_POSIX_CONFIG_EXTERNAL_ROUTE_PRIORITY 65535
#endif
/**