Date: Fri, 2 Oct 2009 11:17:28 +0200 (CEST) From: olli hauer <ohauer@gmx.de> To: FreeBSD-gnats-submit@FreeBSD.org Cc: ohauer@gmx.de, devin@spamcop.net Subject: ports/139306: [MAINTAINER PATCH] port mail/spamd fix ipfw issues Message-ID: <20091002091728.AC7CF26145@u18-124.dsl.vianetworks.de> Resent-Message-ID: <200910020920.n929K2l7022769@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 <ohauer@gmx.de> >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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091002091728.AC7CF26145>