diff options
author | Jonas Gorski <jonas.gorski@bisdn.de> | 2024-05-17 14:22:23 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2024-05-17 15:56:27 (GMT) |
commit | dcb9e2ef8c625aaa029915cd41705d0713f53332 (patch) | |
tree | d46890449df4e865f03d923374b481881c61ac6c | |
parent | d44505ede1ebec0d2e7b038d4e41006a99f657ec (diff) | |
download | libnl-dcb9e2ef8c625aaa029915cd41705d0713f53332.zip libnl-dcb9e2ef8c625aaa029915cd41705d0713f53332.tar.gz libnl-dcb9e2ef8c625aaa029915cd41705d0713f53332.tar.bz2 |
route: add missing priority to route_keygen() debug print
Route priority is part of the hash key calculation, but the debug print
omitted it. This could cause seemingly identical values have different
hash values.
Fix this by also printing the route priority, and reformat according to
clang-format.
Before:
DBG<5>lib/route/route_obj.c:378 route_keygen: route 0x55fd326f7d50 key (fam 10 tos 0 table 254 addr fe80::/64) keysz 26 hash 0x18c
DBG<5>lib/route/route_obj.c:378 route_keygen: route 0x55fd326f7fa0 key (fam 10 tos 0 table 254 addr fe80::/64) keysz 26 hash 0x278
After:
DBG<5>lib/route/route_obj.c:378 route_keygen: route 0x558cfde91d50 key (fam 10 tos 0 table 254 prio 256 addr fe80::/64) keysz 26 hash 0x18c
DBG<5>lib/route/route_obj.c:378 route_keygen: route 0x558cfde91fa0 key (fam 10 tos 0 table 254 prio 1024 addr fe80::/64) keysz 26 hash 0x278
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
https://github.com/thom311/libnl/pull/388
-rw-r--r-- | lib/route/route_obj.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c index 6ff110a..7abb58c 100644 --- a/lib/route/route_obj.c +++ b/lib/route/route_obj.c @@ -375,10 +375,11 @@ static void route_keygen(struct nl_object *obj, uint32_t *hashkey, *hashkey = nl_hash(rkey, rkey_sz, 0) % table_sz; - NL_DBG(5, "route %p key (fam %d tos %d table %d addr %s) keysz %d " - "hash 0x%x\n", route, rkey->rt_family, rkey->rt_tos, - rkey->rt_table, nl_addr2str(addr, buf, sizeof(buf)), - rkey_sz, *hashkey); + NL_DBG(5, + "route %p key (fam %d tos %d table %d prio %d addr %s) keysz %d hash 0x%x\n", + route, rkey->rt_family, rkey->rt_tos, rkey->rt_table, + rkey->rt_prio, nl_addr2str(addr, buf, sizeof(buf)), rkey_sz, + *hashkey); return; } |