aboutsummaryrefslogtreecommitdiff
path: root/src/common/address.c
AgeCommit message (Collapse)Author
2018-09-07Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-07Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-09-07Merge branch 'maint-0.2.9' into maint-0.3.2Nick Mathewson
2018-09-07Windows: Silence a spurious warning in the GetAdaptersAddresses castteor
GetProcAddress() returns FARPROC, which is (long long int(*)()) on 64-bit Windows: https://msdn.microsoft.com/en-us/library/windows/desktop/ms683212(v=vs.85).aspx But GetAdaptersAddresses() is (long unsigned int(*)()), on both 32-bit and 64-bit Windows: https://docs.microsoft.com/en-us/windows/desktop/api/iphlpapi/nf-iphlpapi-getadaptersaddresses So gcc 8 issues a spurious "incompatible function pointer" warning about the cast to GetAdaptersAddresses_fn_t. Silence this warning by casting to a void function pointer, before the cast to GetAdaptersAddresses_fn_t. This issue is already fixed by 26481 in 0.3.5 and later, by removing the lookup and cast. Fixes bug 27465; bugfix on 0.2.3.11-alpha.
2018-04-16Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-16Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-04-16Merge branch 'maint-0.3.2' into maint-0.3.3Nick Mathewson
2018-04-16Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-04-16Fix an LCOV exclusion pattern in address.cNick Mathewson
2018-02-16Merge branch 'maint-0.3.1' into maint-0.3.2Nick Mathewson
2018-02-16Merge branch 'maint-0.2.9' into maint-0.3.1Nick Mathewson
2018-02-15Merge branch 'bug18105'Nick Mathewson
2018-02-13Merge remote-tracking branch 'dgoulet/ticket24902_029_05'Nick Mathewson
2018-02-12Have tor_addr hashes return a randomized hash for AF_UNSPEC.Nick Mathewson
We don't expect this to come up very much, but we may as well make sure that the value isn't predictable (as we do for the other addresses) in case the issue ever comes up. Spotted by teor.
2018-02-09Merge remote-tracking branch 'dgoulet/ticket24902_029_05'Nick Mathewson
2018-02-08Add an address-set backend using a bloom filter.Nick Mathewson
We're going to need this to make our anti-DoS code (see 24902) more robust.
2018-02-07Fix spelling mistakes corresponding to ticket #23650Deepesh Pathak
2018-01-26Use tor_addr_from_getsockname() in several placesNick Mathewson
I'm leaving the getsockname code in transproxy alone, since it is comparatively isolated, rather platform-specific, and hard to test. Implements 18105.
2018-01-10Extract the raw_free() of ifc_buf into a new function.Nick Mathewson
Explain the problem more correctly.
2018-01-10Stop invoking undefined behaviour by using tor_free() on an unaligned pointerteor
... in get_interface_addresses_ioctl(). This pointer alignment issue exists on x86_64 macOS, but is unlikely to exist elsewhere. (i386 macOS only requires 4-byte alignment, and other OSs have 8-byte ints.) Fixes bug 24733; not in any released version of tor.
2017-12-08Convert the rest of src/common's headers to use FREE_AND_NULLNick Mathewson
2017-09-28Move around some LCOV_EXCLs in src/commonNick Mathewson
Apparently, my compiler now generates coverage markers for label-only lines, so we need to exclude those too if they are meant to be unreachable.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-05-26Cleanup MOCK_IMPL (etc) to be findable with etagsNick Mathewson
A fair number of our mock_impl declarations were messed up so that even our special AM_ETAGSFLAGS couldn't find them. This should be a whitespace-only patch.
2017-05-23Fix comments of functions that return tor_snprintfteor
No code changes needed: in the places where we actually check the return value of these functions, we handle it correctly.
2017-04-25Teach cov-exclude to detect runaway LCOV_EXCL_START linesNick Mathewson
Also, fix two instances of runaway LCOV_EXCL_START lines.
2017-03-15Run the copyright update script.Nick Mathewson
2017-01-03Make tor_addr_lookup() mockable.Nick Mathewson
2016-12-23Note memset as redundant; see 20764.Nick Mathewson
2016-12-16Merge branch 'prop271_030_v1_squashed'Nick Mathewson
2016-12-16Lay down some infrastructure for bridges in the New Guard Order.Nick Mathewson
This includes: * making bridge_info_t exposed but opaque * allowing guards where we don't know an identity * making it possible to learn the identity of a guard * creating a guard that lacks a node_t * remembering a guard's address and port. * Looking up a guard by address and port. * Only enforcing the rule that we need a live consensus to update the "listed" status for guards when we are not using bridges.
2016-12-03Clarify that ClientRejectInternalAddresses also rejects mDNS *.local hostsJ. Ryan Stinnett
Fixes #17070.
2016-10-11Switch from "AF_UNIX is always equal" to "always unequal" to avoid wacky ↵Nick Mathewson
bugs. See discussion on 20261
2016-10-11Merge remote-tracking branch 'yawning-schwanenlied/bug20261'Nick Mathewson
2016-10-10Bug 20261: Treat AF_UNIX addresses as equal when comparing them.Yawning Angel
This is a kludge to deal with the fact that `tor_addr_t` doesn't contain `sun_path`. This currently ONLY happens when circuit isolation is being checked, for an isolation mode that is force disabled anyway, so the kludge is "ugly but adequate", but realistically, making `tor_addr_t` and the AF_UNIX SocksPort code do the right thing is probably the better option.
2016-10-03Avoid reordering IPv6 interface addressescypherpunks
When deleting unsuitable addresses in get_interface_address6_list(), to avoid reordering IPv6 interface addresses and keep the order returned by the OS, use SMARTLIST_DEL_CURRENT_KEEPORDER() instead of SMARTLIST_DEL_CURRENT(). This issue was reported by René Mayrhofer. [Closes ticket 20163; changes file written by teor. This paragraph added by nickm]
2016-09-11Merge remote-tracking branch 'public/solaris_warnings_028'Nick Mathewson
2016-07-28Fix a large pile of solaris warnings for bug 19767.Nick Mathewson
In nearly all cases, this is a matter of making sure that we include orconfig.h before we include any standard c headers.
2016-06-15Mark src/common tor_assert(0)/tor_fragile_assert() unreached for coverageNick Mathewson
I audited this to make sure I was only marking ones that really should be unreachable.
2016-06-11Merge branch 'bug19180_easy_squashed'Nick Mathewson
2016-06-11Enable -Wnull-dereference (GCC >=6.1), and fix the easy casesNick Mathewson
This warning, IIUC, means that the compiler doesn't like it when it sees a NULL check _after_ we've already dereferenced the variable. In such cases, it considers itself free to eliminate the NULL check. There are a couple of tricky cases: One was the case related to the fact that tor_addr_to_in6() can return NULL if it gets a non-AF_INET6 address. The fix was to create a variant which asserts on the address type, and never returns NULL.
2016-05-30Replace nearly all XXX0vv comments with smarter onesNick Mathewson
So, back long ago, XXX012 meant, "before Tor 0.1.2 is released, we had better revisit this comment and fix it!" But we have a huge pile of such comments accumulated for a large number of released versions! Not cool. So, here's what I tried to do: * 0.2.9 and 0.2.8 are retained, since those are not yet released. * XXX+ or XXX++ or XXX++++ or whatever means, "This one looks quite important!" * The others, after one-by-one examination, are downgraded to plain old XXX. Which doesn't mean they aren't a problem -- just that they cannot possibly be a release-blocking problem.
2016-03-28Rename tor_dup_addr to tor_addr_to_str_dup.Nick Mathewson
Patch from icanhasaccount; closes 18462.
2016-03-04Correctly duplicate addresses in get_interface_address6_listteor (Tim Wilson-Brown)
2016-03-04Avoid freeing an uninitialised pointer in get_interface_addresses_ioctlteor (Tim Wilson-Brown)
2016-02-27Update the copyright year.Nick Mathewson
2016-02-11Merge remote-tracking branch 'teor/feature17840-v11-merged-v2'Nick Mathewson
2016-02-06Document port_out argument to tor_addr_from_sockaddrNick Mathewson
2016-01-29Merge branch 'feature17840-v11-squashed' into feature17840-v11-mergedteor (Tim Wilson-Brown)
Conflicts: src/or/directory.c src/test/test_routerlist.c Fix minor conflicts.
2016-01-29Fix *_get_all_orports to use ipv6_orportteor (Tim Wilson-Brown)
node_get_all_orports and router_get_all_orports incorrectly used or_port with IPv6 addresses. They now use ipv6_orport. Also refactor and remove duplicated code.