]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix Squid <-> pinger communication.
authorwessels <>
Fri, 20 Apr 2007 03:25:38 +0000 (03:25 +0000)
committerwessels <>
Fri, 20 Apr 2007 03:25:38 +0000 (03:25 +0000)
Somebody thought it would be nice to use a socketpair(), rather than
a UDP socket, for squid-pinger IPC.  But socketpair() messages cannot
be larger than 4096 bytes.  Pinger is sending ~8KB messages back to
Squid, so we must use UDP (or something that supports large messages).

src/icmp.cc

index 9071042fa43e09d050bde8ddb064d5a23e33dc90..859c17c3ea834824d6e4b4d61b5b008795bd3c55 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: icmp.cc,v 1.89 2006/09/11 09:36:06 serassio Exp $
+ * $Id: icmp.cc,v 1.90 2007/04/19 21:25:38 wessels Exp $
  *
  * DEBUG: section 37    ICMP Routines
  * AUTHOR: Duane Wessels
@@ -238,7 +238,12 @@ icmpOpen(void)
     int wfd;
     args[0] = "(pinger)";
     args[1] = NULL;
-    pid = ipcCreate(IPC_DGRAM,
+    /*
+     * Do NOT use IPC_DGRAM (=IPC_UNIX_DGRAM) here because you can't
+     * send() more than 4096 bytes on a socketpair() socket (at
+     * least on FreeBSD).
+     */
+    pid = ipcCreate(IPC_UDP_SOCKET,
                     Config.Program.pinger,
                     args,
                     "Pinger Socket",