summaryrefslogtreecommitdiff
path: root/security/stunnel/files/patch-src::client.c
diff options
context:
space:
mode:
authorPeter Pentchev <roam@FreeBSD.org>2011-01-04 16:37:24 +0000
committerPeter Pentchev <roam@FreeBSD.org>2011-01-04 16:37:24 +0000
commit5431ebd5df605571e88fd5ef9ed122179f60dae2 (patch)
treeb6e73f0fdad43d5f91f91a8c3d3c5f16d0e3301e /security/stunnel/files/patch-src::client.c
parentFix a logfile permissions (security) bug. (diff)
Implement transparent proxying using the IP_BINDANY option if available in
a way a bit different (and a bit more generic) than the one in the PR. While I'm here, declare the GPL-2+ license and remove the MD5 checksum. PR: 153568 Submitted by: Jason Helfman <jhelfman@experts-exchange.com>
Notes
Notes: svn path=/head/; revision=267383
Diffstat (limited to 'security/stunnel/files/patch-src::client.c')
-rw-r--r--security/stunnel/files/patch-src::client.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/security/stunnel/files/patch-src::client.c b/security/stunnel/files/patch-src::client.c
new file mode 100644
index 000000000000..ff6956a35df0
--- /dev/null
+++ b/security/stunnel/files/patch-src::client.c
@@ -0,0 +1,29 @@
+Description: Allow transparent proxying using IP_BINDANY.
+Forwarded: yes
+Author: Peter Pentchev <roam@FreeBSD.org>,
+ Jason Helfman <jhelfman@experts-exchange.com>
+Last-Updated: 2011-01-04
+
+--- src/client.c.orig
++++ src/client.c
+@@ -1034,15 +1034,16 @@
+ static void local_bind(CLI *c) {
+ SOCKADDR_UNION addr;
+
+-#ifdef IP_TRANSPARENT
++#ifdef STUNNEL_TRANSPARENT
+ int on=1;
+ if(c->opt->option.transparent) {
+- if(setsockopt(c->fd, SOL_IP, IP_TRANSPARENT, &on, sizeof on))
+- sockerror("setsockopt IP_TRANSPARENT");
++ if(setsockopt(c->fd, STUNNEL_TRANSPARENT_LEVEL,
++ STUNNEL_TRANSPARENT, &on, sizeof on))
++ sockerror("setsockopt " STUNNEL_TRANSPARENT_NAME);
+ /* ignore the error to retain Linux 2.2 compatibility */
+ /* the error will be handled by bind(), anyway */
+ }
+-#endif /* IP_TRANSPARENT */
++#endif /* STUNNEL_TRANSPARENT */
+
+ memcpy(&addr, &c->bind_addr.addr[0], sizeof addr);
+ if(ntohs(addr.in.sin_port)>=1024) { /* security check */