Created attachment 255318 [details] patch for rtnl_handle_iflink type mismatch In sys/net/if_var.h, the type for ifnet_link_event is defined as: ``` /* Interface link state change event */ typedef void (*ifnet_link_event_handler_t)(void *, if_t, int); EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); ``` However, in sys/netlink/route/iface.c, the rtnl_handle_iflink() function, which only takes two arguments, is registered as a handler for ifnet_link_event. ``` static void rtnl_handle_iflink(void *arg, if_t ifp) { NL_LOG(LOG_DEBUG2, "ifnet %s", if_name(ifp)); rtnl_handle_ifevent(ifp, NL_RTM_NEWLINK, 0); } ... iflink_event = EVENTHANDLER_REGISTER( ifnet_link_event, rtnl_handle_iflink, NULL, EVENTHANDLER_PRI_ANY); ```
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=0289db3259532d51ebe58bc0b2647a0d9e6cae66 commit 0289db3259532d51ebe58bc0b2647a0d9e6cae66 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-11-22 13:52:57 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-11-22 14:03:40 +0000 netlink/route: Fix the argument list for rtnl_handle_iflink() This function is registered as a ifnet_link_event and so should have the corresponding argument list. PR: 282870 Reported by: nakayamakenjiro@gmail.com MFC after: 1 week sys/netlink/route/iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a2f54460e39a915a72df095a3de52a844335024b commit a2f54460e39a915a72df095a3de52a844335024b Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-11-22 13:52:57 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-11-28 14:41:52 +0000 netlink/route: Fix the argument list for rtnl_handle_iflink() This function is registered as a ifnet_link_event and so should have the corresponding argument list. PR: 282870 Reported by: nakayamakenjiro@gmail.com MFC after: 1 week (cherry picked from commit 0289db3259532d51ebe58bc0b2647a0d9e6cae66) sys/netlink/route/iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)