diff options
author | jhay <jhay@FreeBSD.org> | 2007-03-15 02:42:40 +0800 |
---|---|---|
committer | jhay <jhay@FreeBSD.org> | 2007-03-15 02:42:40 +0800 |
commit | c9d90e662746a64853580e8275a1b302a93b7d91 (patch) | |
tree | 890f583d10a42341de82c9d1fc5b4e160e7fd275 /www/ffproxy | |
parent | bfe89061cf20376d7e310e6e5659329a1649de0e (diff) | |
download | freebsd-ports-gnome-c9d90e662746a64853580e8275a1b302a93b7d91.tar.gz freebsd-ports-gnome-c9d90e662746a64853580e8275a1b302a93b7d91.tar.zst freebsd-ports-gnome-c9d90e662746a64853580e8275a1b302a93b7d91.zip |
Fix access control and logging of IPv6 addresses.
Diffstat (limited to 'www/ffproxy')
-rw-r--r-- | www/ffproxy/files/patch-socket.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/www/ffproxy/files/patch-socket.c b/www/ffproxy/files/patch-socket.c new file mode 100644 index 000000000000..68a7a3261363 --- /dev/null +++ b/www/ffproxy/files/patch-socket.c @@ -0,0 +1,35 @@ +--- socket.c.orig Fri Dec 31 10:59:54 2004 ++++ socket.c Thu Nov 9 20:19:53 2006 +@@ -58,7 +58,7 @@ + open_socket(void) + { + extern struct cfg config; +- struct sockaddr claddr; ++ struct sockaddr_storage claddr; + struct addrinfo hints[2], *res; + struct clinfo *clinfo; + struct pollfd s[2]; +@@ -135,7 +135,6 @@ + if (config.bind_ipv6) + info("waiting for requests on %s port %d (IPv6)", *config.ipv6 ? config.ipv6 : "(any)", config.port); + +- claddr_len = sizeof(claddr); + config.ccount = 0; + cl = 0; + isipv4 = config.bind_ipv4; +@@ -160,13 +159,14 @@ + } + } else + st = s[0].fd; ++ claddr_len = sizeof(claddr); + if ((cl = accept(st, (struct sockaddr *) & claddr, &claddr_len)) == -1) { + DEBUG(("open_socket() => accept() failed")); + continue; + } + + DEBUG(("open_socket() => connection, checking access")); +- clinfo = identify(&claddr, (socklen_t) isipv4 ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6)); ++ clinfo = identify((struct sockaddr *)&claddr, claddr_len); + if (check_access(clinfo) != 0) { + DEBUG(("open_socket() => no access")); + if (config.logrequests) |