[Mimedefang] [Patch] relay_is_* not ipv6 friendly

Michiel Brandenburg apex at xepa.nl
Tue Feb 2 11:23:54 EST 2010

On 2-2-2010 15:37, David F. Skoll wrote:
> +        if( $ip[$_] =~ /\./ ) {
> +            # ipv4 mapped as ipv6
> +            my @extraOcts = unpack('H4H4', pack('C4C4C4C4', split(/\./,
> Actually, the Perl code will never see an IPv6-mapped IPv4 address, because
> the mimedefang.c code converts such an address to "pure" IPv4:
Ahh good to know ... there u go .. in a mixed environment ( c and perl ) 
u never know where to look :)

Is that a good approach btw ? Ipv6 mapped ipv4 address are ipv6 not ipv4 
addresses in the strictest terms, no? I though the only way you could 
receive these types of hybrid addresses were if you are ipv6 only and 
your client is ipv4 only (with a transparent ipv4 -> ipv6 gateway in 
between somewhere).

Say you are on a ipv4 only network you would never receive those 
addresses while if you are on a ipv6 only network all of a sudden you 
might get data from an ipv4 address (but you are ipv6 only), that might 
throw a spanner in the works.

The ipv6 mapped ipv4 should only happen on a hybrid or ipv6 only stack. 
For checking RBL lists it might be interesting to check both the ipv4 
and the ipv6 variant of the same address.  But to do that you would need 
the ipv6 variant :), dunno if it's worth changing or how much would 
break if it were changed.

Lemme know what you guys think, my ipv6 knowledge is not that up to 
date, I can refactor the patch if needed, or better yet change the patch 
so we can check both ipv4 and ipv6 if we want.


More information about the MIMEDefang mailing list