Re: couriertcpd listening to the wrong IPv6 address

Alessandro Vesely <[email protected]> Sat, 1 Jun 2024 12:29:35 +0200
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
On Fri 31/May/2024 17:29:49 +0200 Sam Varshavchik wrote:
> Alessandro Vesely writes:
>>
>> Since they are so many, I thought I can afford a different address for every 
>> service, so I configured 2a02:29e1:500:6c00::2.25 in esmtpd.  That's the IP 
>> of an MX host, but nobody wrote and now I got why:  Courier is not listening 
>> to it.  It seems somehow it dropped the last byte of the address, or do I 
>> have something wrong?
>>
>> [configuration dropped except netstat]
>> 659-north:courier#
>> 659-north:courier# netstat -ltnp | grep 2a02| grep courier
>> tcp6       0      0 2a02:29e1:500:6c00:::25 :::*                    LISTEN      7261/couriertcpd
>>
>> Can you spot what's wrong?
>
> It really looks to me like it's netstat's output that's chopping it off.
>
> To reproduce this I added code to set the IP_FREEBIND option on the listening 
> socket (and I'll keep this change),


Good, that may prevent nuisances if the ppp interface fails to come up at startup.


> so that I can reproduce this verbatim:
>
> $ strace -s 256 ./couriertcpd 2a02:29e1:500:6c00::2.2525 /bin/false 2>&1 | grep bind
> bind(3, {sa_family=AF_INET6, sin6_port=htons(2525), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "2a02:29e1:500:6c00::2", &sin6_addr), sin6_scope_id=0}, 28) = 0


Thank you for that!  It does the same at mine.


> strace is logging the correct IP address dropping into the socket.
> 
> Once I saw that, a Google search confirmed this diagnosis:
> 
> https://askubuntu.com/questions/834807/format-of-ipv6-addresses-in-the-netstat-output


Heck, IPv6 land seems to be so rarely visited.


Best
Ale
-- 







_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users