From: Amos Jeffries Date: Fri, 11 Jan 2013 10:02:21 +0000 (-0700) Subject: Polish debug messages on Path MTU discovery on client connections X-Git-Tag: SQUID_3_4_0_1~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bb672760d0a91fc746a9276d1d8a2e808341e3c;p=thirdparty%2Fsquid.git Polish debug messages on Path MTU discovery on client connections * Display errors when PMTUd disable operation fails * Correct debug message about PMTUd support being absent Detected by Coverity Scan. Issue 740319 --- diff --git a/src/client_side.cc b/src/client_side.cc index bbcd1d8214..c29f5479da 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -3299,13 +3299,14 @@ connStateCreate(const Comm::ConnectionPointer &client, AnyP::PortCfg *port) (result->transparent() || port->disable_pmtu_discovery == DISABLE_PMTU_ALWAYS)) { #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) int i = IP_PMTUDISC_DONT; - setsockopt(client->fd, SOL_IP, IP_MTU_DISCOVER, &i, sizeof i); + if (setsockopt(client->fd, SOL_IP, IP_MTU_DISCOVER, &i, sizeof(i)) < 0) + debugs(33, 2, "WARNING: Path MTU discovery disabling failed on " << client << " : " << xstrerror()); #else - static int reported = 0; + static bool reported = false; if (!reported) { - debugs(33, DBG_IMPORTANT, "Notice: httpd_accel_no_pmtu_disc not supported on your platform"); - reported = 1; + debugs(33, DBG_IMPORTANT, "NOTICE: Path MTU discovery disabling is not supported on your platform."); + reported = true; } #endif }