JSON version of the route/show command prints out the internal priority
field. Users should not rely on this number, they should only rely on
the table numbers, the protocol and the longest prefix match to know
which route will be matched for a particular packet, all this info is
available in the output.
The internal priority is a combination of that other data and differs
between OVS versions due to differences in the route caching
implementation. It is also not the rta_priority that kernel reports
for routes, which is confusing.
And we do not print this number in the non-JSON version of the output.
Fixes: d000ff1cd564 ("ovs-router: Add JSON output for 'ovs/route/show'
command.")
Reported-at:
https://mail.openvswitch.org/pipermail/ovs-dev/2025-September/426284.html
Signed-off-by: Ilya Maximets <[email protected]>
---
lib/ovs-router.c | 1 -
tests/ovs-router.at | 5 -----
2 files changed, 6 deletions(-)
diff --git a/lib/ovs-router.c b/lib/ovs-router.c
index c11a52764..496690b46 100644
--- a/lib/ovs-router.c
+++ b/lib/ovs-router.c
@@ -691,7 +691,6 @@ ovs_router_show_json(struct json *json_routes, const struct
classifier *cls,
json_object_put(json, "user", json_boolean_create(rt->user));
json_object_put(json, "local",
json_boolean_create(table == CLS_LOCAL && !rt->user));
- json_object_put(json, "priority", json_integer_create(rt->priority));
json_object_put(json, "prefix", json_integer_create(plen));
json_object_put_string(nh, "dev", rt->output_netdev);
diff --git a/tests/ovs-router.at b/tests/ovs-router.at
index b5282fd19..97eb95fad 100644
--- a/tests/ovs-router.at
+++ b/tests/ovs-router.at
@@ -38,7 +38,6 @@ AT_CHECK([ovs-appctl --format=json --pretty ovs/route/show],
[0], [dnl
"dev": "br0"}],
"prefix": 32,
"prefsrc": "2.2.2.2",
- "priority": 128,
"table": 255,
"user": false},
{
@@ -50,7 +49,6 @@ AT_CHECK([ovs-appctl --format=json --pretty ovs/route/show],
[0], [dnl
"dev": "br0"}],
"prefix": 32,
"prefsrc": "2.2.2.2",
- "priority": 160,
"table": 254,
"user": true},
{
@@ -61,7 +59,6 @@ AT_CHECK([ovs-appctl --format=json --pretty ovs/route/show],
[0], [dnl
"dev": "br0"}],
"prefix": 24,
"prefsrc": "2.2.2.2",
- "priority": 120,
"table": 254,
"user": false},
{
@@ -73,7 +70,6 @@ AT_CHECK([ovs-appctl --format=json --pretty ovs/route/show],
[0], [dnl
"gateway": "2.2.2.10"}],
"prefix": 24,
"prefsrc": "2.2.2.2",
- "priority": 152,
"table": 254,
"user": true},
{
@@ -86,7 +82,6 @@ AT_CHECK([ovs-appctl --format=json --pretty ovs/route/show],
[0], [dnl
"gateway": "2.2.2.10"}],
"prefix": 24,
"prefsrc": "2.2.2.2",
- "priority": 152,
"table": 254,
"user": true}]]
])
--
2.52.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev