Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] milter-greylist 3.0 alpha3 is out

2006-08-28 by Hajimu UMEMOTO

Hi,

>>>>> On Mon, 28 Aug 2006 09:43:55 +0200
>>>>> manu@... said:

manu> Here is the alpha3 of milter-greylist 3.0

It seems there are two problems:

- Since sin_addr and sin6_addr has different offset in struct
  sockaddr, we cannot just use sa_data.

- There is an environment where struct sockaddr_storage is not
  provided.

Here is a patch:

Index: dnsrbl.c
diff -u -p dnsrbl.c.orig dnsrbl.c
--- dnsrbl.c.orig	Mon Aug 28 05:54:41 2006
+++ dnsrbl.c	Mon Aug 28 18:57:26 2006
@@ -102,7 +102,7 @@ dnsrbl_check_source(sa, salen, source)
 #ifdef HAVE_RESN
 	struct __res_state res;
 #endif
-	struct sockaddr_storage ss;
+	sockaddr_t ss;
 	char req[NS_MAXDNAME + 1];
 	char ans[NS_MAXMSG + 1];
 	int anslen;
@@ -291,10 +291,12 @@ dnsrbl_source_add(name, domain, blacklis
 	LIST_INSERT_HEAD(&dnsrbl_head, de, d_list);
 
 	if (conf.c_debug || conf.c_acldebug) {
-		struct sockaddr *sa = (struct sockaddr *)&de->d_blacklisted;
-
-		inet_ntop(sa->sa_family, sa->sa_data,
-		    addrstr, sizeof(addrstr)); 
+		if ((iptostring(SA(&de->d_blacklisted), salen, addrstr,
+		    sizeof(addrstr))) == NULL) {
+			mg_log(LOG_ERR, "iptostring failed: %s",
+			    strerror(errno));
+			exit(EX_SOFTWARE);
+		}
 		mg_log(LOG_DEBUG, "load DNSRBL \"%s\" \"%s\" %s", 
 		    de->d_name, de->d_domain, addrstr);
 	}
Index: dnsrbl.h
diff -u dnsrbl.h.orig dnsrbl.h
--- dnsrbl.h.orig	Sat Jul 29 00:41:51 2006
+++ dnsrbl.h	Mon Aug 28 18:56:18 2006
@@ -40,7 +40,7 @@
 struct dnsrbl_entry {
 	char d_name[QSTRLEN + 1];
 	char d_domain[NS_MAXDNAME + 1];
-	struct sockaddr_storage d_blacklisted;
+	sockaddr_t d_blacklisted;
 	LIST_ENTRY(dnsrbl_entry) d_list;
 };
 

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@...  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.