Right now Tor has large hairy functions such as get_interface_address6() and get_interface_addresses_raw() that attempt to use system-specific API to try and get an IP address of network interface Tor instance is currently using. They should be refactored to improve code readability and maintainability. Also, we need to make sure there are unit tests for this kind of code.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
mock functions in test_config.c should documentation (eg, "This is a mock function to replace X; this replacement does Y.")
Otherwise, this looks fine, assuming test coverage is okay
reviewing if_addr_refactoring branch:
The tests look good, assuming coverage is okay
Instead of duplicating the "+#ifdef HAVE_GETIFADDRS ...#elif define(_WIN32)) ...#elif defined(SIOCGIFCONF) && defined(HAVE_IOCTL) " checks in a few places, it's probably better to have address.h do "#define HAVE_IFADDRS_TO_SMARTLIST" in the first case, and #define HAVE_IP_ADAPTER_ADDRESSES_TO_SMARTLIST in the second case, and so on. Then the other code can check those more readable macros.
All the new functions in address.c need documentation.
Otherwise, looks good!
(For more info on our documentation style, and on getting test coverage, see doc/HACKING. )