Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
route-table: Fix another UBsan warning about pointer type.
The 'parse()' callback has a function type with 'void *change' argument. In all other cases it is used this way, except for the route_table_parse(). That generates UBsan error: lib/netlink-notifier.c:190:25: runtime error: call to function route_table_parse through pointer to incorrect function type 'int (*)(struct ofpbuf *, void *)' lib/route-table.c:227: note: route_table_parse defined here 0 0x24d0 in nln_run lib/netlink-notifier.c:190:25 1 0x7b39 in route_table_run lib/route-table.c:137:9 2 0x5565 in netdev_vport_run lib/netdev-vport.c:364:5 3 0xe978 in netdev_run lib/netdev.c:192:13 4 0x2f25 in main vswitchd/ovs-vswitchd.c:132:9 5 0xa1c9 in __libc_start_call_main 6 0xa28a in __libc_start_main 7 0xf004 in _start (vswitchd/ovs-vswitchd+0x726004) Instead of turning off function sanitizer, let's just define this callback as all the other parsing callbacks and cast the void pointer inside the implementation. This fixes system tests on Ubuntu 24.04 with UBsan. Acked-by: Simon Horman <horms@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
- Loading branch information