Commit b7ebed87 authored by Mati's avatar Mati

Implemented fix-socket patch

parent 7c9a1577
httptunnel (3.3+dfsg-3kali0) kali; urgency=low
* Implemented fix-socket patch
-- Mati Aharoni <muts@kali.org> Wed, 15 Jan 2014 16:49:27 -0500
httptunnel (3.3+dfsg-3) unstable; urgency=low
* Bump to debhelper v9.
......
diff --git a/tunnel.c b/tunnel.c
index 2edc05c..d7b8c0d 100644
--- a/tunnel.c
+++ b/tunnel.c
@@ -140,30 +140,25 @@ struct tunnel
tunnel_in_setsockopts (int fd)
{
#ifdef SO_RCVLOWAT
- int tcp = get_proto_number ("tcp");
+ int i, n;
- if (tcp != -1)
- {
- int i, n;
-
- i = 1;
- if (setsockopt (fd,
- tcp,
- SO_RCVLOWAT,
- (void *)&i,
- sizeof i) == -1)
- {
- log_debug ("tunnel_in_setsockopts: non-fatal SO_RCVLOWAT error: %s",
- strerror (errno));
- }
- n = sizeof i;
- getsockopt (fd,
- tcp,
+ i = 1;
+ if (setsockopt (fd,
+ SOL_SOCKET,
SO_RCVLOWAT,
(void *)&i,
- &n);
- log_debug ("tunnel_out_setsockopts: SO_RCVLOWAT: %d", i);
+ sizeof i) == -1)
+ {
+ log_debug ("tunnel_in_setsockopts: non-fatal SO_RCVLOWAT error: %s",
+ strerror (errno));
}
+ n = sizeof i;
+ getsockopt (fd,
+ SOL_SOCKET,
+ SO_RCVLOWAT,
+ (void *)&i,
+ &n);
+ log_debug ("tunnel_out_setsockopts: SO_RCVLOWAT: %d", i);
#endif /* SO_RCVLOWAT */
return 0;
@@ -174,30 +169,26 @@ struct tunnel
{
#ifdef SO_SNDLOWAT
{
- int tcp = get_proto_number ("tcp");
int i, n;
- if (tcp != -1)
- {
- i = 1;
- if (setsockopt (fd,
- tcp,
- SO_SNDLOWAT,
- (void *)&i,
- sizeof i) == -1)
- {
- log_debug ("tunnel_out_setsockopts: "
- "non-fatal SO_SNDLOWAT error: %s",
- strerror (errno));
- }
- n = sizeof i;
- getsockopt (fd,
- tcp,
+ i = 1;
+ if (setsockopt (fd,
+ SOL_SOCKET,
SO_SNDLOWAT,
(void *)&i,
- &n);
- log_debug ("tunnel_out_setsockopts: non-fatal SO_SNDLOWAT: %d", i);
+ sizeof i) == -1)
+ {
+ log_debug ("tunnel_out_setsockopts: "
+ "non-fatal SO_SNDLOWAT error: %s",
+ strerror (errno));
}
+ n = sizeof i;
+ getsockopt (fd,
+ SOL_SOCKET,
+ SO_SNDLOWAT,
+ (void *)&i,
+ &n);
+ log_debug ("tunnel_out_setsockopts: non-fatal SO_SNDLOWAT: %d", i);
}
#endif /* SO_SNDLOWAT */
......@@ -5,3 +5,4 @@
05-update-email-address.patch
06-fix-cppflags-usage.patch
07-quote-autoconf-definitions.patch
08-fix-socket.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment