From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Oct 2 09:20:03 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EF401065679 for ; Fri, 2 Oct 2009 09:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8F38FC0A for ; Fri, 2 Oct 2009 09:20:03 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n929K2Q7022782 for ; Fri, 2 Oct 2009 09:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n929K2l7022769; Fri, 2 Oct 2009 09:20:02 GMT (envelope-from gnats) Resent-Date: Fri, 2 Oct 2009 09:20:02 GMT Resent-Message-Id: <200910020920.n929K2l7022769@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, olli hauer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AF14106568D for ; Fri, 2 Oct 2009 09:17:37 +0000 (UTC) (envelope-from ohauer@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 9E1338FC1A for ; Fri, 2 Oct 2009 09:17:36 +0000 (UTC) Received: (qmail invoked by alias); 02 Oct 2009 09:17:34 -0000 Received: from u18-124.dsl.vianetworks.de (EHLO u18-124.dsl.vianetworks.de) [194.231.39.124] by mail.gmx.net (mp039) with SMTP; 02 Oct 2009 11:17:34 +0200 Received: by u18-124.dsl.vianetworks.de (Postfix, from userid 1100) id AC7CF26145; Fri, 2 Oct 2009 11:17:28 +0200 (CEST) Message-Id: <20091002091728.AC7CF26145@u18-124.dsl.vianetworks.de> Date: Fri, 2 Oct 2009 11:17:28 +0200 (CEST) From: olli hauer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: ohauer@gmx.de, devin@spamcop.net Subject: ports/139306: [MAINTAINER PATCH] port mail/spamd fix ipfw issues X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: olli hauer List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2009 09:20:03 -0000 >Number: 139306 >Category: ports >Synopsis: [MAINTAINER PATCH] port mail/spamd fix ipfw issues >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Fri Oct 02 09:20:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: olli hauer >Release: FreeBSD 7.2-RELEASE i386 >Organization: >Environment: >Description: Two issues reported by Tod McQuillin for spamd in combination ipfw. - ipfw table and spamdb runs out of sync - a new socket was opened every time greyscan runs (every 60s) which results in 'to many open files' failure. Thanks to Tod for reporting and providing a patch to resolve the issues olli hauer >How-To-Repeat: run spamd with ipfw instead pf - spamdb WHITE entries and ipfw table are different after a while also duplicate WHITE entries are possible. - after a view hundred's greyscan runs spamd and possible the system runs out of free file descriptors >Fix: --- patch_mail_spamd.txt begins here --- --- Makefile +++ Makefile @@ -7,7 +7,7 @@ PORTNAME= spamd PORTVERSION= 4.5.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail MASTER_SITES= BERLIOS MASTER_SITE_SUBDIR=freebsdspamd --- /dev/null +++ files/patch-spamd__grey.c @@ -0,0 +1,29 @@ +--- ./spamd/grey.c.orig ++++ ./spamd/grey.c +@@ -329,9 +329,10 @@ + { + ipfw_table_entry ent; + int i; +- static int ipfw_socket; ++ static int ipfw_socket = 0; + +- ipfw_socket = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); ++ if (ipfw_socket == 0) ++ ipfw_socket = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); + + if (debug) + fprintf(stderr, "configure ipfw tabno: %d\n", ipfw_tabno); +@@ -363,8 +364,11 @@ + inet_aton(addrs[i], (struct in_addr *)&ent.addr); + if (setsockopt(ipfw_socket, IPPROTO_IP, IP_FW_TABLE_ADD, &ent, sizeof(ent)) < 0) + { +- syslog_r(LOG_INFO, &sdata, "IPFW setsockopt(IP_FW_TABLE_ADD) (%m)"); +- return(-1); ++ /* work around dups */ ++ if (errno != EEXIST) { ++ syslog_r(LOG_INFO, &sdata, "IPFW setsockopt(IP_FW_TABLE_ADD) (%m)"); ++ return(-1); ++ } + } + } + --- patch_mail_spamd.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: