diff --git a/src/addrtable.c b/src/addrtable.c index c405154..4357e7a 100644 --- a/src/addrtable.c +++ b/src/addrtable.c @@ -81,6 +81,8 @@ void addr_table_init(void) return; } + addr_table_base = (addr_table_entry_t*)(addr_table_header + 1); + if(new_table) { /* Initialise the address table. */ @@ -96,6 +98,8 @@ void addr_table_init(void) return; } + + addr_table_unlock(); } /* Release all handles to the address table and associated objects. */ diff --git a/src/ipxwrapper.c b/src/ipxwrapper.c index 3e5a438..2c064ee 100644 --- a/src/ipxwrapper.c +++ b/src/ipxwrapper.c @@ -31,6 +31,7 @@ #include "interface.h" #include "router.h" #include "addrcache.h" +#include "addrtable.h" extern const char *version_string; extern const char *compile_time; @@ -91,12 +92,16 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) return FALSE; } + addr_table_init(); + router_init(); } else if(why == DLL_PROCESS_DETACH) { router_cleanup(); + addr_table_cleanup(); + WSACleanup(); DeleteCriticalSection(&sockets_cs);