File:  [ELWIX - Embedded LightWeight unIX -] / fwsync / patches / alias_db.patch
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Mon Jul 11 21:26:34 2022 UTC (23 months ago) by misho
Branches: MAIN
CVS tags: HEAD
final version of patch synced according driver

    1: diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c
    2: index 4612b32c139..2cb25981d17 100644
    3: --- a/sys/netinet/libalias/alias_db.c
    4: +++ b/sys/netinet/libalias/alias_db.c
    5: @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
    6:  #include <netinet/libalias/alias_local.h>
    7:  #include <netinet/libalias/alias_mod.h>
    8:  #include <net/if.h>
    9: +#include <net/vnet.h>
   10:  #else
   11:  #include "alias.h"
   12:  #include "alias_local.h"
   13: @@ -63,6 +64,17 @@ __FBSDID("$FreeBSD$");
   14:  
   15:  #include "alias_db.h"
   16:  
   17: +#ifndef V_hook_alias
   18: +typedef int (*ipfw_hook_t)(const void *arg);
   19: +/* callback hooks for notify on update of internal states and aliases */
   20: +VNET_DECLARE(ipfw_hook_t, hook_state);
   21: +#define V_hook_state		VNET(hook_state)
   22: +VNET_DECLARE(ipfw_hook_t, hook_alias);
   23: +#define V_hook_alias		VNET(hook_alias)
   24: +#endif
   25: +
   26: +VNET_DEFINE(ipfw_hook_t, hook_alias) = NULL;
   27: +
   28:  static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead);
   29:  int LibAliasTime;
   30:  
   31: @@ -708,6 +720,9 @@ AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr,
   32:  	if (la->packetAliasMode & PKT_ALIAS_LOG)
   33:  		ShowAliasStats(la);
   34:  
   35: +	if (lnk && V_hook_alias)
   36: +		V_hook_alias(lnk);
   37: +
   38:  	return (lnk);
   39:  }
   40:  

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>