--- fwsync/patches/alias_db.patch 2022/08/16 00:32:41 1.5 +++ fwsync/patches/alias_db.patch 2022/08/23 14:27:13 1.6 @@ -1,5 +1,5 @@ diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c -index 4612b32c139..cd18638ac17 100644 +index 4612b32c139..7ef0282fdb8 100644 --- a/sys/netinet/libalias/alias_db.c +++ b/sys/netinet/libalias/alias_db.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); @@ -10,10 +10,11 @@ index 4612b32c139..cd18638ac17 100644 #else #include "alias.h" #include "alias_local.h" -@@ -63,6 +64,21 @@ __FBSDID("$FreeBSD$"); +@@ -63,6 +64,23 @@ __FBSDID("$FreeBSD$"); #include "alias_db.h" ++#ifdef _KERNEL +#ifndef V_hook_alias +typedef int (*ipfw_hook_t)(const void *arg, const void *extdata); +/* callback hooks for notify on update of internal states and aliases */ @@ -28,11 +29,12 @@ index 4612b32c139..cd18638ac17 100644 +#endif + +VNET_DEFINE(ipfw_hook_t, hook_alias) = NULL; ++#endif + static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead); int LibAliasTime; -@@ -566,9 +582,14 @@ AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, +@@ -566,9 +584,14 @@ AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, int alias_port_param, int link_type) { struct alias_link *lnk; @@ -47,12 +49,14 @@ index 4612b32c139..cd18638ac17 100644 lnk = malloc(sizeof(struct alias_link)); if (lnk == NULL) { #ifdef LIBALIAS_DEBUG -@@ -708,6 +729,9 @@ AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, +@@ -708,6 +731,11 @@ AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, if (la->packetAliasMode & PKT_ALIAS_LOG) ShowAliasStats(la); ++#ifdef _KERNEL + if (!sync && lnk && V_hook_alias) + V_hook_alias(lnk, NULL); ++#endif + return (lnk); }