ports/139306: [MAINTAINER PATCH] port mail/spamd fix ipfw issues
olli hauer
ohauer at gmx.de
Fri Oct 2 09:20:03 UTC 2009
>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 at 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:
More information about the freebsd-ports-bugs
mailing list