summaryrefslogtreecommitdiff
path: root/src/or/geoip.c
AgeCommit message (Collapse)Author
2017-06-05Merge branch 'maint-0.2.8' into maint-0.2.9Nick Mathewson
2017-06-05Merge branch 'maint-0.2.7-redux' into maint-0.2.8Nick Mathewson
2017-06-05Merge branch 'maint-0.2.5' into maint-0.2.6Nick Mathewson
2017-06-05Merge branch 'maint-0.2.4' into maint-0.2.5Nick Mathewson
2017-06-05Fix undefined behavior in geoip_parse_entry().Nick Mathewson
Fixes bug 22490; bugfix on 6a241ff3ffe7dc1 in 0.2.4.6-alpha. Found by teor using clang-5.0's AddressSanitizer stack-use-after-scope.
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-07-28Fix all -Wshadow warnings on LinuxNick Mathewson
This is a partial fix for 18902.
2016-06-11Add the -Wextra-semi warning from clang, and fix the cases where it triggersNick 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-02-27Update the copyright year.Nick Mathewson
2015-12-18Fix a null-pointer deref when writing geoip statsNick Mathewson
Found by coverity; CID 1327892.
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-11-23fix two typos in commentsRoger Dingledine
2015-09-15Add tests for directory_handle_command_getReinaldo de Souza Jr
2015-02-03Merge branch 'bug6852'Nick Mathewson
Conflicts: src/or/status.c
2015-02-03Choose a more deliberate cutoff for clients in heartbeatNick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-02Apply new calloc coccinelle patchNick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-02Another clang analyzer complaint wrt HT_GENERATENick Mathewson
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro with the result of a product. But that makes any sane analyzer worry about overflow. This patch keeps HT_GENERATE having its old semantics, since we aren't the only project using ht.h. Instead, define a HT_GENERATE2 that takes a reallocarrayfn.
2014-08-29Introduce full coverage tests for module routerset.c.dana koch
This is using the paradigm introduced for test_status.c.
2014-08-13Apply coccinelle script to replace malloc(a*b)->calloc(a,b)Nick Mathewson
2014-03-25Fix warnings from doxygenNick Mathewson
Most of these are simple. The only nontrivial part is that our pattern for using ENUM_BF was confusing doxygen by making declarations that didn't look like declarations.
2014-02-28Merge remote-tracking branch 'karsten/task-5824'Nick Mathewson
2014-02-12Siphash-2-4 is now our hash in nearly all cases.Nick Mathewson
I've made an exception for cases where I'm sure that users can't influence the inputs. This is likely to cause a slowdown somewhere, but it's safer to siphash everything and *then* look for cases to optimize. This patch doesn't actually get us any _benefit_ from siphash yet, since we don't really randomize the key at any point.
2013-12-18Report complete directory request statistics on bridges.Karsten Loesing
When we wrote the directory request statistics code in August 2009, we thought that these statistics were only relevant for bridges, and that bridges should not report them. That's why we added a switch to discard relevant observations made by bridges. This code was first released in 0.2.2.1-alpha. In May 2012 we learned that we didn't fully disable directory request statistics on bridges. Bridges did report directory request statistics, but these statistics contained empty dirreq-v3-ips and dirreq-v3-reqs lines. But the remaining dirreq-* lines have always been non-empty. (We didn't notice for almost three years, because directory-request statistics were disabled by default until 0.2.3.1-alpha, and all statistics have been removed from bridge descriptors before publishing them on the metrics website.) Proposal 201, created in May 2012, suggests to add a new line called bridge-v3-reqs that is similar to dirreq-v3-reqs, but that is published only by bridges. This proposal is still open as of December 2013. Since October 2012 we're using dirreq-v3-resp (not -reqs) lines in combination with bridge-ips lines to estimate bridge user numbers; see task 8462. This estimation method has superseded the older approach that was only based on bridge-ips lines in November 2013. Using dirreq-v3-resp and bridge-ips lines is a workaround. The cleaner approach would be to use dirreq-v3-reqs instead. This commit makes bridges report the same directory request statistics as relays, including dirreq-v3-ips and dirreq-v3-reqs lines. It makes proposal 201 obsolete.
2013-08-15Add a clientmap_entry_free().Nick Mathewson
Remove a nedless strdup/free pair.
2013-08-15Fix hash functions for transport_name in client entryNick Mathewson
2013-08-15Use only uintptr_t for the value of transport_countNick Mathewson
2013-08-15If a single client connects with multiple transports, note all transports.George Kadianakis
2013-08-15Fix a number of issues with the #5040 code.George Kadianakis
- Don't leak if a transport proxy sends us a TRANSPORT command more than once. - Don't use smartlist_string_isin() in geoip_get_transport_history(). (pointed out by Nick) - Use the 'join' argument of smartlist_join_strings() instead of trying to write the separator on our own. (pointed out by Nick) - Document 'ext_or_transport' a bit better. (pointed out by Nick) - Be a bit more consistent with the types of the values of 'transport_counts'. (pointed out by Nick)
2013-08-15Make check-spaces happy.George Kadianakis
2013-07-18Write extra-info bridge-ip-transports lines.George Kadianakis
2013-07-18Add transport information to the GeoIP database.George Kadianakis
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-05-24Reformat 4282 fixes a littleNick Mathewson
2013-05-24Fix a logic error in 4282 fixesNick Mathewson
check_or_create_data_subdir has succeeded when it returns 0, not when it returns negative.
2013-05-24Extract duplicate code in geoip and rephist.Peter Retzlaff
Create new methods check_or_create_data_subdir() and write_to_data_subdir() in config.c and use them throughout rephist.c and geoip.c. This should solve ticket #4282.
2013-02-26Add unique client counter to the heartbeat message.George Kadianakis
2013-02-07Merge remote-tracking branch 'public/bug7816_023'Nick Mathewson
Conflicts: src/common/util.c
2013-01-17Remove dirreq-v2-* lines from extra-info descriptors.Karsten Loesing
Implements the rest of #5823.
2013-01-16Removee dirrec-v*-sharestatisticsNick Mathewson
These were unused and sometimes inaccurate. Resolves 5823.
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-12-28Fix various small leaks on error casesNick Mathewson
Spotted by coverity, bug 7816, bugfix on various versions.
2012-12-13Nuke uses of memcmp outside of unit testsNick Mathewson
We want to be saying fast_mem{cmp,eq,neq} when we're doing a comparison that's allowed to exit early, or tor_mem{cmp,eq,neq} when we need a data-invariant timing. Direct use of memcmp tends to imply that we haven't thought about the issue.
2012-11-04Whitespace fixesNick Mathewson
2012-11-04Merge remote-tracking branch 'linus/bug5053-bug5055'Nick Mathewson
Conflicts: src/or/geoip.c
2012-10-31Change some comments to reflect the multitude of GeoIP databases.Linus Nordberg
2012-10-31Don't memcmp struct in6_addr but rather its s6_addr member.Linus Nordberg
2012-10-31Duplicate less code.Linus Nordberg