Yahoo Groups archive

Milter-greylist

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

Message

Re: [milter-greylist] Submitter DNS name resolution and forgery detection

2013-08-16 by manu@...

Hajimu UMEMOTO <ume@...> wrote:

> manu> You mean we first have to strip "[" or "[IPv6:" ? 
> 
> JFYI, RFC 5321 defines address-literal as follows:
> 
> address-literal  = "[" ( IPv4-address-literal /
>                    IPv6-address-literal /
>                    General-address-literal ) "]"
>                    ; See Section 4.1.3
> 
> IPv4-address-literal  = Snum 3("."  Snum)
> 
> IPv6-address-literal  = "IPv6:" IPv6-addr

I tried the test program published earlier on NetBSD, "::1" is resolved
to "localhost", "IPv6:::1" is not. I guess IPv6: shall be stripped.

I get it working with this:

        if (strncmp(addr, "[IPv6:", 6) == 0) {
                (void)strncpy(abuf, addr + 6, len - 7);
                abuf[len - 7] = '\0';
        } else {        /* Strip leading '[' and trailing ']' */
                (void)strncpy(abuf, addr + 1, len - 2);
                abuf[len - 2] = '\0';
        }

I wonder if this is a but in NetBSD getnameinfo(3)

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

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.