Date: Thu, 20 Oct 2022 20:24:18 GMT From: John Baldwin <jhb@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: c9665e214f72 - main - net/ng_mikrotik_eoip: Fix build after recent changes in main. Message-ID: <202210202024.29KKOIWM089424@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb (doc, src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=c9665e214f726d9a6e62af00d81b94567ebe2572 commit c9665e214f726d9a6e62af00d81b94567ebe2572 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-10-20 20:22:02 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-10-20 20:22:02 +0000 net/ng_mikrotik_eoip: Fix build after recent changes in main. src commit 6d5f002ed1187547b0b40f8b46a3db38bf89c6dc changed the API of NG_NODE_FOREACH_HOOK to remove a mostly unused parameter. Use a structure as the callback argument to save the returned hook. PR: 266392 Differential Revision: https://reviews.freebsd.org/D36545 --- .../files/patch-ng__mikrotik__eoip.c | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/net/ng_mikrotik_eoip/files/patch-ng__mikrotik__eoip.c b/net/ng_mikrotik_eoip/files/patch-ng__mikrotik__eoip.c new file mode 100644 index 000000000000..4649334fe687 --- /dev/null +++ b/net/ng_mikrotik_eoip/files/patch-ng__mikrotik__eoip.c @@ -0,0 +1,60 @@ +--- ng_mikrotik_eoip.c.orig 2022-09-13 07:45:40 UTC ++++ ng_mikrotik_eoip.c +@@ -193,26 +193,54 @@ static ng_fn_eachhook check_id; + #ifndef NO_LINEAR_HOOK_LOOKUP + static ng_fn_eachhook check_id; + ++#if __FreeBSD_version >= 1400057 ++struct check_id_data { ++ hook_p result; ++ uint16_t id; ++}; ++#endif ++ + static int +-check_id(hook_p hook, void *id) ++check_id(hook_p hook, void *arg) + { + struct tunnel_info *info = NG_HOOK_PRIVATE(hook); ++#if __FreeBSD_version >= 1400057 ++ struct check_id_data *data = arg; ++#endif ++ uint16_t id; + +- if (info != NULL && info->id == (uint16_t)(*((unsigned int *)id))) ++#if __FreeBSD_version >= 1400057 ++ id = data->id; ++#else ++ id = *((unsigned int *)id; ++#endif ++ if (info != NULL && info->id == id) { ++#if __FreeBSD_version >= 1400057 ++ data->result = hook; ++#endif + return 0; +- else ++ } else + return 1; + } + + static hook_p + find_hook(node_p node, uint16_t id) + { ++#if __FreeBSD_version >= 1400057 ++ struct check_id_data data; ++ ++ data.result = NULL; ++ data.id = id; ++ NG_NODE_FOREACH_HOOK(node, check_id, &data); ++ return data.result; ++#else + hook_p result = NULL; + unsigned int val = id; + + NG_NODE_FOREACH_HOOK(node, check_id, (void*)&val, result); + + return result; ++#endif + } + #endif /* NO_LINEAR_HOOK_LOOKUP */ +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210202024.29KKOIWM089424>