summaryrefslogtreecommitdiff
path: root/src/common/address.c
AgeCommit message (Collapse)Author
2012-07-06Fix port range in parse_port_range().George Kadianakis
2012-06-15Triage the XXX023 and XXX022 comments: postpone many.Nick Mathewson
2012-06-05Fix "make check-spaces" issuesNick Mathewson
2012-06-04Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson
2012-05-16Merge remote-tracking branch 'public/bug2822'Nick Mathewson
2012-04-12Fix issues found by nickm.George Kadianakis
* Document fmt_addr_impl() and friends. * Parenthesize macro arguments. * Rename get_first_listener_addrport_for_pt() to get_first_listener_addrport_string(). * Handle port_cfg_t with no_listen. * Handle failure of router_get_active_listener_port_by_type(). * Add an XXX to router_get_active_listener_port_by_type().
2012-03-31Generalize fmt_addr() to support IPv6 decorations.George Kadianakis
2012-03-28Reject SOCKS requests for "localhost" or ".local"Nick Mathewson
Sending them on is futile, since we will be told "127.0.0.1" and then think we've been lied to. Partial fix for 2822.
2012-03-27Log statement to help track down bug4091Nick Mathewson
2012-01-31Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32Nick Mathewson
This commit is completely mechanical; I used this perl script to make it: #!/usr/bin/perl -w -i.bak -p if (/^\s*\#/) { s/MS_WINDOWS/_WIN32/g; s/\bWIN32\b/_WIN32/g; }
2012-01-18Rename nonconformant identifiers.Nick Mathewson
Fixes bug 4893. These changes are pure mechanical, and were generated with this perl script: /usr/bin/perl -w -i.bak -p s/crypto_pk_env_t/crypto_pk_t/g; s/crypto_dh_env_t/crypto_dh_t/g; s/crypto_cipher_env_t/crypto_cipher_t/g; s/crypto_digest_env_t/crypto_digest_t/g; s/aes_free_cipher/aes_cipher_free/g; s/crypto_free_cipher_env/crypto_cipher_free/g; s/crypto_free_digest_env/crypto_digest_free/g; s/crypto_free_pk_env/crypto_pk_free/g; s/_crypto_dh_env_get_dh/_crypto_dh_get_dh/g; s/_crypto_new_pk_env_rsa/_crypto_new_pk_from_rsa/g; s/_crypto_pk_env_get_evp_pkey/_crypto_pk_get_evp_pkey/g; s/_crypto_pk_env_get_rsa/_crypto_pk_get_rsa/g; s/crypto_new_cipher_env/crypto_cipher_new/g; s/crypto_new_digest_env/crypto_digest_new/g; s/crypto_new_digest256_env/crypto_digest256_new/g; s/crypto_new_pk_env/crypto_pk_new/g; s/crypto_create_crypto_env/crypto_cipher_new/g; s/connection_create_listener/connection_listener_new/g; s/smartlist_create/smartlist_new/g; s/transport_create/transport_new/g;
2011-12-28Add interface enumeration based on SIOCGIFCONF for older unixesNick Mathewson
2011-12-28Multicast addresses, if any were configured, would not be good if addrsNick Mathewson
2011-12-28Use getifaddrs, not connect+getsockname, to find our addressNick Mathewson
This resolves bug1827, and lets us avoid freaking people out. Later, we can use it to get a complete list of our interfaces.
2011-12-02Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-12-02Fix bug 4530; check return val of tor_addr_lookup correctlyNick Mathewson
Fix on 0.2.1.5-alpha; reported by troll_un
2011-11-30Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-11-23Detect tor_addr_to_str failure in tor_dup_addr.Nick Mathewson
This avoids a possible strdup of an uninitialized buffer. Fixes 4529; fix on 0.2.1.3-alpha; reported by troll_un.
2011-11-16Don't allow building on platforms where AF_UNSPEC != 0Sebastian Hahn
2011-11-14Merge remote-tracking branch '4ZM/topic/test/4433_address'Nick Mathewson
2011-11-11Return value bugfix of tor_addr_to_PTR_nameAnders Sundman
Returns value semantics was inconsitent between IPv4 and IPv6
2011-11-11Fixed buffer bounds check bug in tor_addr_to_strAnders Sundman
2011-10-11Stop using addr_port_lookup as an address splitting functionNick Mathewson
It's too risky to have a function where if you leave one parameter NULL, it splits up address:port strings, but if you set it, it does hostname resolution.
2011-10-11Change "reverse_lookup_name" functions to refer to "PTR_name"sNick Mathewson
Under the new convention, having a tor_addr.*lookup function that doesn't do hostname resolution is too close for comfort. I used this script here, and have made no other changes. s/tor_addr_parse_reverse_lookup_name/tor_addr_parse_PTR_name/g; s/tor_addr_to_reverse_lookup_name/tor_addr_to_PTR_name/g;
2011-10-11Fix names of functions that convert strings to addrsNick Mathewson
Now let's have "lookup" indicate that there can be a hostname resolution, and "parse" indicate that there wasn't. Previously, we had one "lookup" function that did resolution; four "parse" functions, half of which did resolution; and a "from_str()" function that didn't do resolution. That's confusing and error-prone! The code changes in this commit are exactly the result of this perl script, run under "perl -p -i.bak" : s/tor_addr_port_parse/tor_addr_port_lookup/g; s/parse_addr_port(?=[^_])/addr_port_lookup/g; s/tor_addr_from_str/tor_addr_parse/g; This patch leaves aton and pton alone: their naming convention and behavior is is determined by the sockets API. More renaming may be needed.
2011-07-20Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-07-20Check return value in fmt_addrNick Mathewson
Previously, if tor_addr_to_str() returned NULL, we would reuse the last value returned by fmt_addr(). (This could happen if we were erroneously asked to format an AF_UNSPEC address.) Now instead we return "???".
2011-05-13Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/or/config.c src/or/dirserv.c src/or/or.h
2011-05-13Add a new "tor_sockaddr_to_str()" functionNick Mathewson
It does what it says on the tin. It turns out I'll want this in a couple of places.
2011-05-11Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023Nick Mathewson
Conflicts in various places, mainly node-related. Resolved them in favor of HEAD, with copying of tor_mem* operations from bug3122_memcmp_022. src/common/Makefile.am src/or/circuitlist.c src/or/connection_edge.c src/or/directory.c src/or/microdesc.c src/or/networkstatus.c src/or/router.c src/or/routerlist.c src/test/test_util.c
2011-05-11Merge remote-tracking branch 'public/3122_memcmp_squashed' into ↵Nick Mathewson
bug3122_memcmp_022 Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
2011-05-11Automated conversion of memcmp to tor_memcmp/tor_mem[n]eqNick Mathewson
This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
2011-04-19Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-04-19Standardize our printf code on %d, not %i.Nick Mathewson
2011-04-07Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Conflicts: src/common/address.c src/common/compat_libevent.c src/common/memarea.c src/common/util.h src/or/buffers.c src/or/circuitbuild.c src/or/circuituse.c src/or/connection.c src/or/directory.c src/or/networkstatus.c src/or/or.h src/or/routerlist.c
2011-03-28Improve a few commentsSebastian Hahn
2011-03-25Triage the XXX022 and XXX021 comments remaining in the codeNick Mathewson
Remove some, postpone others, leave some alone. Now the only remaining XXX022s are ones that seem important to fix or investigate.
2011-03-25Fixup tor_addr_to_sockaddr return conventionNick Mathewson
2011-03-16Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
Trivial Conflicts in src/common/crypto.c src/or/main.h src/or/or.h
2011-03-16Doxygen documentation for about 100 things that didn't have anyNick Mathewson
About 860 doxygen-less things remain in 0.2.2
2011-03-16Fix up all doxygen warnings other than "foo is not documented"Nick Mathewson
2011-03-07Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-03-05Fix setting target port in get_interface_address6Sebastian Hahn
We want to use the discard port correctly, so a htons() was missing. Also we need to set it correctly depending on address family. Review provided by danieldg
2011-03-05Fix connect() failures in get_interface_address6()Sebastian Hahn
The third argument for connect should be dependent on the address family. Issue spotted by piebeer who also wrote the patch.
2011-01-03Merge remote branch 'origin/maint-0.2.2'Nick Mathewson
2011-01-03Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
Conflicts: src/common/test.h src/or/test.c
2011-01-03Bump copyright statements to 2011Nick Mathewson
2010-10-15clarify fmt_addr32 documentation to note that the address is in host-orderNick Mathewson
2010-10-15Merge branch 'bug1992_part1'Nick Mathewson
2010-10-15Make the return value of tor_addr_sockaddr always be signedNick Mathewson