Henrik Nordstrom wrote:
tis 2009-09-15 klockan 23:59 +1200 skrev Amos Jeffries:
+        if ( (tmp_sock = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP))
= 0 &&
+            setsockopt(tmp_sock, SOL_IP, IP_TRANSPARENT, (char
*)&tos, sizeof(int)) == 0 &&
+            bind(tmp_sock, (struct sockaddr*)&tmp_ip6, sizeof(struct
sockaddr_in6)) == 0 ) {
+
+            debugs(3, 3, "IPv6 TPROXY support detected. Using.");
+            shutdown(tmp_sock, SHUT_RDWR);
+            return true;

Hmm... that shutdown should be a close(). If not you'll lose the
filedescriptor.

Applies to the other uses of shutdown() there as well I think.
shutdown(SHUT_RDWR) is not a synonym for close().

Regards
Henrik


Thanks. Thought there was something unusual about shutdown(). I tried fclose() by bad-habit earlier and gcc complained (Yeah, I know why). shutdown() was what the socket() and bind() manual pages said so I followed along that way instead of using close().

Fixed.

Amos
--
Please be using
  Current Stable Squid 2.7.STABLE6 or 3.0.STABLE19
  Current Beta Squid 3.1.0.13

Reply via email to