Commit Graph
12 Commits
Author SHA1 Message Date
Evgeny c24a6367cc add IPv6 default route interface auto-detection for permanent/temporary IPv6 without netif
- get_default_route_netif_index(): UDP connect trick + getifaddrs to find default route iface
- etcp_socket_add(): auto-detect netif_index when not specified in config
- queue_new() API: explicit index_offset/index_size params instead of implicit from hash_size
- radix: cleanup types (uint8_t*), replace bzero/bcmp with memset/memcmp, remove kernel ifdefs
- route6_lib: new IPv6 routing library + get_node_v6_routes()
2026-05-10 00:05:23 +03:00
Evgeny 097e1acc6d queue: add variable size hash
bgp: add to headers new node info
2026-03-28 21:52:46 +03:00
jeka 1811764f6d +queue names 2026-03-06 21:01:24 +03:00
Evgeny a0c4727b8b Fix: Added explicit type casts for ll_queue type conversions
- Fixed all incompatible pointer type warnings in src/etcp.c
- Fixed warnings in src/pkt_normalizer.c
- Fixed warnings in tests/test_etcp_simple_traffic.c
- Fixed warnings in tests/test_etcp_100_packets.c
- Fixed warnings in tests/test_ll_queue.c
- Fixed DEBUG_CATEGORY_ALL overflow warning in debug_config.h
- Fixed DEBUG_CATEGORY_LL_QUEUE redefinition warning in test_ll_queue.c
- Fixed write() unused result warning in test_u_async_comprehensive.c
2026-02-02 10:30:16 +03:00
Evgeny 9a5db10939 Refactor: Code cleanup and improvements across multiple modules
- Refactored ll_queue.c/h with improved error handling
- Cleaned up pkt_normalizer.c memory management
- Updated etcp.c with better logging
- Fixed test files compilation warnings
- General code quality improvements
2026-02-01 23:47:55 +03:00
Evgeny 0d75546ff0 Replace printf with DEBUG_ macros in simple_test.c, test_packet_dump.c, test_intensive_memory_pool.c 2026-01-26 18:25:48 +03:00
Evgeny 3ddfb79338 Backup before replacing all printf with DEBUG_ macros in tests 2026-01-26 17:52:50 +03:00
Evgeny 1bafe6a681 Backup before fixing etcp_connections list addition 2026-01-26 17:40:51 +03:00
Evgeny d74f76a5a0 Fix: Resolved double free in timeout_heap_pop() and test_etcp_simple_traffic bind conflict
- Fixed incorrect init_connections() call in test_etcp_simple_traffic.c (was calling server_instance instead of client_instance)
- Fixed double free in timeout_heap_pop() when handling deleted elements
- Enhanced NULL pointer safety in uasync_print_resources() by removing complex heap manipulation
- Added debug logging to timeout_heap_pop() for better error tracking

Test results: test_etcp_simple_traffic now passes without double free errors
2026-01-25 10:47:02 +03:00
Evgeny f1a76c9d30 Fix memory leaks and crashes in ETCP tests
✅ Fixed critical segmentation fault (SIGABRT) in test_etcp_two_instances
✅ Added comprehensive timer debug logging with DEBUG_CATEGORY_TIMERS
✅ Created uasync_print_resources() function for resource diagnostics
✅ Created utun_instance_diagnose_leaks() function for leak analysis
✅ Fixed cleanup order - cancel timers before destroying uasync instances
✅ Fixed timer cancellation to properly update counters
✅ Fixed socket cleanup to unregister from uasync before destruction
✅ Added detailed diagnostic output for memory leak tracking
✅ All tests now pass without crashes

Key fixes:
- Fixed use-after-free in test cleanup sequence
- Added proper timer leak detection and cleanup
- Enhanced debug capabilities for future debugging
- Fixed ETCP socket cleanup to prevent resource leaks

The test_etcp_two_instances now runs successfully without segmentation faults.
2026-01-22 00:57:45 +03:00
Evgeny 3f0a23aa93 Fix build: rename u_async to lib, add missing constants, out-of-tree build support 2026-01-18 16:18:28 +03:00
Evgeny 8d9340c949 Refactor: Move mainloop from utun_instance to main
Major architectural changes:
- utun_instance_run() now does single iteration instead of mainloop
- Added tun_read_callback() to handle TUN device packets
- Added utun_instance_register_sockets() for uasync integration
- Mainloop moved to main() with proper signal handling
- Removed parse config file functions from debug_config
- all fprintf replaced with DEBUG_* macros

Files changed:
- src/utun.c: Added mainloop, signal handlers, proper init order
- src/utun_instance.c: Added callback, socket registration, single-run
- src/utun_instance.h: Added declarations, tun_socket_id field
- u_async/debug_config.c: Removed file parsing and auto-reload
- u_async/debug_config.h: Removed file functions, added categories
- changelog.txt: Added all changes

Breaking changes:
- debug_parse_config_file() removed (use debug_parse_config() only)
- etcp crypto integration needs fixing (separate issue)

AGENTS.md principles followed:
- No backward compatibility preserved
- Removed 103+ lines of legacy code
- Added statistics tracking
- Clean architecture: create -> init -> register -> run -> destroy
2026-01-18 14:28:57 +03:00