On Sun, Nov 23, 2014 at 02:17:23PM -0500, Wietse Venema wrote:

> I have a preference for the design that addresses the problem at a
> lower level in the stack, so that the solution is not limited to
> the SMTP client and not limited to inet protocol selection.
> 
> That code can then also be used to address other forms of trouble
> that manifest themselves via DNS (for example the next time someone
> changes the meaning of some corner case, like nullmx).
> 
> I have a draft implementation that is being tested.

Feel free to compare notes.  The code changes in inet_proto.c are
for example policy neutral, this just supports on-the-fly protocol
settings for whatever code happens to want such data.  I forgot to
include one last change for that module, that avoids too large a
mask array should we ever support more than 2 protocols. (2^2^n
happens to equal 2*2^n for n=1,2).

diff --git a/src/util/inet_proto.c b/src/util/inet_proto.c
index 31b1ac1..d572c47 100644
--- a/src/util/inet_proto.c
+++ b/src/util/inet_proto.c
@@ -131,7 +131,7 @@ static const NAME_MASK proto_table[] = {
  /*
   * Cache by mask value.
   */
-static INET_PROTO_INFO *info_by_mask[1<<INET_PROTO_MASK_LAST];
+static INET_PROTO_INFO *info_by_mask[INET_PROTO_MASK_LAST<<1];
 
 /* make_uchar_vector - create and initialize uchar vector */


I hope the low level mechanism in question will apply with some
specificity, e.g. for particular MX hosts among many for the same
nexthop domain.  Some domains mix Google and non-google MX hosts.
If some day their non-Google MX hosts only support IPv6, we might
inadverantly disable these entirely:

    kortingisleuk.nl. IN MX 10 kortingisleuk.nl.
    kortingisleuk.nl. IN A 85.17.142.4
    kortingisleuk.nl. IN MX 10 ASPMX.L.GOOGLE.COM.
    kortingisleuk.nl. IN MX 20 ALT1.ASPMX.L.GOOGLE.COM.
    kortingisleuk.nl. IN MX 20 ALT2.ASPMX.L.GOOGLE.COM.
    kortingisleuk.nl. IN MX 30 ASPMX2.GOOGLEMAIL.COM.
    kortingisleuk.nl. IN MX 30 ASPMX3.GOOGLEMAIL.COM.
    kortingisleuk.nl. IN MX 30 ASPMX4.GOOGLEMAIL.COM.
    kortingisleuk.nl. IN MX 30 ASPMX5.GOOGLEMAIL.COM.

Likewise, were someone to chose to only use IPv6 with Google some
day.

-- 
        Viktor.

Reply via email to