Commit Graph
13 Commits
Author SHA1 Message Date
jeka b27ea97055 1 2026-02-22 23:28:11 +03:00
jeka 3ab19094d0 Fix: segfault in ETCP tests and add wintun.dll to gitignore
- Fix segfault in ETCP tests by initializing uECC RNG in sc_init_local_keys()
- Fix segfault during cleanup by adding reference counting to socket_platform_cleanup()
- Add wintun.dll to .gitignore
- Update AGENTS.md and platform compatibility headers

All 19 tests now pass successfully.
2026-02-16 23:36:50 +03:00
jeka 4a3c5724b7 Windows: Исправлен запуск utun - TUN, логирование, права администратора
- Добавлен platform_compat.c с кроссплатформенной генерацией случайных чисел
- Исправлена генерация ключей и node_id на Windows (вместо /dev/urandom)
- PID файл отключен по умолчанию на Windows
- Добавлено двойное логирование: файл utun.log + консоль
- Добавлен манифест Windows для запроса прав администратора
- Исправлено завершение программы при ошибках отправки (Network unreachable)
- TUN инициализация включена по умолчанию
- Исправлен main loop (instance->running = 1)
2026-02-16 14:31:16 +03:00
jeka c8af35c4b9 Fix u_async: Windows socket registration, timers, and poll issues
- Remove FD_SETSIZE check for Windows sockets (can have any value)
- Fix process_timeouts to handle all expired timers (continue instead of break)
- Handle case when no sockets to poll (sleep instead of calling poll)
- Disable wakeup pipe on Windows (incompatible with WSAPoll)
- Add gettimeofday and ssize_t implementations for Windows
2026-02-15 17:38:45 +03:00
Evgeny f510d78bb5 Fix Windows: use sys/time.h for gettimeofday, remove custom implementation 2026-02-15 12:57:53 +03:00
Evgeny 4403c46788 Fix Windows build: skip gettimeofday on MSYS2, force recompile ecc_platform_specific 2026-02-15 12:26:32 +03:00
Evgeny 0798b149ab Fix Windows build: use WSAPoll instead of poll for linking 2026-02-15 03:54:35 +03:00
Evgeny 605a928350 Fix Windows build: POSIX dependencies (netdb.h, fork, setsid, SIGHUP, etc.)
- Wrap POSIX headers (netdb.h, ifaddrs.h, net/if.h) in #ifndef _WIN32 in config_parser.c
- Add Windows stub for get_netif_index() - returns 0 (no interface binding)
- Wrap daemonize() function for Windows - returns 0 (no fork/setsid support)
- Replace setlinebuf() with setvbuf() for Windows compatibility
- Wrap SIGHUP signal handler in #ifndef _WIN32
- Add explicit poll() declaration for Windows in platform_compat.h
- All 22 tests pass on Linux
2026-02-15 03:26:02 +03:00
Evgeny c83fdeeaad Fix Windows build: add sa_family_t typedef, replace arpa/inet.h, fix ll_queue warnings
- Add sa_family_t typedef for Windows in platform_compat.h
- Add forward declaration of struct ll_queue in ll_queue.h to fix warnings
- Replace arpa/inet.h includes with platform_compat.h in:
  tun_linux.c, etcp_connections.c, route_lib.c, route_bgp.c,
  utun_instance.c, routing.c, utun.c, packet_dump.h, config_parser.c
- All 22 tests pass on Linux
2026-02-15 03:06:02 +03:00
Evgeny 9b1d43996e Remove #include <poll.h> from Windows section - already in winsock2.h 2026-02-15 02:58:32 +03:00
Evgeny 1bd4bf5d11 Fix Windows build errors: config_parser.h, poll(), localtime()
- Replace sys/socket.h with platform_compat.h in config_parser.h
- Add #include <poll.h> for Windows in platform_compat.h
- Fix localtime() type mismatch: cast tv.tv_sec to time_t
- All 22 tests pass on Linux
2026-02-15 02:56:08 +03:00
Evgeny 0688efcd0e Fix platform_compat.h - remove duplicate definitions for MSYS2
- Remove duplicate struct pollfd (already in winsock2.h)
- Remove duplicate struct timezone (already in time.h)
- Remove duplicate nanosleep (already in pthread_time.h)
- Add fcntl.h include for _O_BINARY
- Use platform_pipe/fcntl to avoid naming conflicts
- All 22 tests pass on Linux
2026-02-15 02:52:27 +03:00
Evgeny 0c43a633b9 Add platform_compat.h for Windows POSIX compatibility
- Add platform_compat.h with Windows implementations of:
  * gettimeofday() using GetSystemTimeAsFileTime
  * poll() using select()
  * pipe() using _pipe()
  * fcntl() using ioctlsocket for O_NONBLOCK
  * pollfd structure and POLL* constants
  * strcasecmp/strncasecmp macros

- Update debug_config.c and u_async.c/h to use platform_compat.h
- Remove POSIX-specific headers (arpa/inet.h, sys/time.h, etc.)
- All 22 tests pass on Linux
- Fixes build errors on Windows MSYS2
2026-02-15 02:46:41 +03:00