Re: IPv6 recap

Sam Varshavchik <[email protected]>
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
Sam Varshavchik writes:

… and here's the patch.

diff --git a/rfc1035/rfc1035mxlist.c b/rfc1035/rfc1035mxlist.c
index cd08a111..10eb6203 100644
--- a/rfc1035/rfc1035mxlist.c
+++ b/rfc1035/rfc1035mxlist.c
@@ -82,7 +82,6 @@ static int harvest_records(struct rfc1035_res *res,
 	int q_type, int *found, int autoquery, int port);

 #define	HARVEST_AUTOQUERY	1
-#define	HARVEST_NODUPE		2

 static int add_arecords(struct rfc1035_res *res, struct rfc1035_mxlist **list,
 			struct rfc1035_reply *mxreply,
@@ -136,33 +135,33 @@ records weren't found.
 	if (mxreply && !(opts & RFC1035_MX_QUERYALL))
 	{
 		rc2=harvest_records(res, list, mxreply, mxpreference,
-				    mxname, second_a, &found, HARVEST_NODUPE,
+				    mxname, second_a, &found, 0,
 				    port);

 		if (rc2 != RFC1035_MX_OK && rc2 != RFC1035_MX_SOFTERR)
 			return rc2;

 		rc=harvest_records(res, list, mxreply, mxpreference,
-				   mxname, first_a, &found, 0, port);
+				   mxname, first_a, &found, 0,
+				   port);

 		if (rc != RFC1035_MX_OK && rc != RFC1035_MX_SOFTERR)
 			return (rc);

 		if (rc == RFC1035_MX_SOFTERR && rc2 == RFC1035_MX_SOFTERR)
 			return rc;
-
-		if (found)	return (RFC1035_MX_OK);
 	}

 	rc2=harvest_records(res, list, mxreply, mxpreference, mxname,
-			    second_a, &found, HARVEST_AUTOQUERY|HARVEST_NODUPE,
+			    second_a, &found, HARVEST_AUTOQUERY,
 			    port);

 	if (rc2 != RFC1035_MX_OK && rc2 != RFC1035_MX_SOFTERR)
 		return rc2;

 	rc=harvest_records(res, list, mxreply, mxpreference, mxname,
-			   first_a, &found, HARVEST_AUTOQUERY, port);
+			   first_a, &found, HARVEST_AUTOQUERY,
+			   port);

 	if (rc != RFC1035_MX_OK && rc != RFC1035_MX_SOFTERR)
 		return (rc);
@@ -264,13 +263,20 @@ static int harvest_records(struct rfc1035_res *res,
 #if RFC1035_IPV6
 		if (q_type == RFC1035_TYPE_A)
 		{
-		struct rfc1035_mxlist *q;
-
 			/* Map it to an IPv4 address */

 			rfc1035_ipv4to6(&in,
 				&mxreply->allrrs[index]->rr.inaddr);

+		}
+		else
+		{
+			in=mxreply->allrrs[index]->rr.in6addr;
+		}
+
+		{
+			struct rfc1035_mxlist *q;
+
 			/* See if it's already here */

 			for (q= *list; q; q=q->next)
@@ -285,10 +291,8 @@ static int harvest_records(struct rfc1035_res *res,
 					== 0 && q->priority == mxpreference)
 					break;
 			}
-			if ((flags & HARVEST_NODUPE) && q)	continue;
+			if (q)	continue;
 		}
-		else
-			in=mxreply->allrrs[index]->rr.in6addr;
 #else
 		in.s_addr=mxreply->allrrs[index]->rr.inaddr.s_addr;
 #endif



_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.