aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-10-02 22:13:37 +0000
committerNick Mathewson <nickm@torproject.org>2006-10-02 22:13:37 +0000
commit4de9f45d6f24b991d6d30c2f85c1fc50604b8fd3 (patch)
treebc3e9c71dd94dd24606b0532509e0bfb63d533b5 /src
parentbff83b666c4c363d8e31051ba309d9290c6170fb (diff)
downloadtor-4de9f45d6f24b991d6d30c2f85c1fc50604b8fd3.tar
tor-4de9f45d6f24b991d6d30c2f85c1fc50604b8fd3.tar.gz
r8850@totoro: nickm | 2006-10-02 17:21:11 -0400
Make TrackExitHosts case-insensitive, and fix the behavior of .suffix TrackExitHosts items to avoid matching in the middle of an address. (Resolves an XXXX) svn:r8579
Diffstat (limited to 'src')
-rw-r--r--src/or/circuituse.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 4ccd4c1be..092208b63 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1120,14 +1120,13 @@ consider_recording_trackhost(edge_connection_t *conn, origin_circuit_t *circ)
SMARTLIST_FOREACH(options->TrackHostExits, const char *, cp, {
if (cp[0] == '.') { /* match end */
- /* XXX strstr is probably really bad here. */
- if ((str = strstr(conn->socks_request->address, &cp[1]))) {
+ if (!strcasecmpend(conn->socks_request->address, cp)) {
if (str == conn->socks_request->address
|| strcmp(str, &cp[1]) == 0) {
found_needle = 1;
}
}
- } else if (strcmp(cp, conn->socks_request->address) == 0) {
+ } else if (strcasecmp(cp, conn->socks_request->address) == 0) {
found_needle = 1;
}
});