ports/56105: mini_sendmail-1.3.2 fails completely (IPv6, FreeBSD 4-STABLE)

Matthias Andree matthias.andree at gmx.de
Thu Aug 28 22:10:20 UTC 2003


>Number:         56105
>Category:       ports
>Synopsis:       mini_sendmail-1.3.2 fails completely (IPv6, FreeBSD 4-STABLE)
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 28 15:10:18 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
System: FreeBSD libertas.emma.line.org 4.8-STABLE FreeBSD 4.8-STABLE #44: Sun Aug 17 20:27:05 CEST 2003 root at libertas.emma.line.org:/usr/src/sys/compile/LIBERTAS i386


	
>Description:
The IPv6 code that mini_sendmail enables by default is defective,
at least on FreeBSD 4.8, mini_sendmail doesn't work at all.

I installed mini_sendmail from package, recompiling the port (same version)
doesn't make a difference.

Impact: mini_sendmail doesn't work.

Sample outputs:

Without arguments:
# mini_sendmail </dev/null
mini_sendmail: connect: Can't assign requested address

(strace info)
...
socket(PF_INET6, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "::", &s
in6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EADDRNOTAVAIL (Can't assi
gn requested address)
...

As we can see, the port has not been set to 25 as it ought to have been.

With server IP:
# mini_sendmail -s127.0.0.1 </dev/null
mini_sendmail: connect: Can't assign requested address

With hostname it connects somewhere else:
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(25), sin_addr=inet_addr("144.144.4
.8")}, 16 <unfinished ...>

(Side note: SuSE Linux 8.1, glibc 2.2.5, kernel 2.4.22, returns ECONNREFUSED
rather than EADDRNOTAVAIL. I wonder what system mini_sendmail was tested on
before release.)

Asking "host" or "ping", the same hostname yields 192.168.0.2 instead.

Apparently the address handling in the USE_IPV6 code paths is broken.

Adding #undef USE_IPV6 before the first check fixes things up at the expense
of disabling IPv6 support, but this is not the real fix.

>How-To-Repeat:
	
See above.
>Fix:
THIS IS NOT A REAL FIX, JUST A BAND-AID to make the code work with IPv4.

I don't have the time to fix mini_sendmail and send stuff upstream on short
notice, and a better patch than this should be used to make IPv6 actually work
rather than just disable it.

Should this patch be applied: committer, please remove the ipv6 category
and mind you this patch creates a new file in the files/ subdirectory.
(Have your mug of coffee before committing ;-)

REMEMBER to use "patch -p0" to apply this patch so the file goes into files/
rather than the working directory!

diff -Nur /usr/ports/mail/mini_sendmail/files/patch-disable-ipv6 /root/mini_sendmail/files/patch-disable-ipv6
--- files/patch-disable-ipv6	Thu Jan  1 01:00:00 1970
+++ files/patch-disable-ipv6	Thu Aug 28 23:45:42 2003
@@ -0,0 +1,10 @@
+--- mini_sendmail.c~	Thu Nov 21 21:27:55 2002
++++ mini_sendmail.c	Thu Aug 28 23:39:54 2003
+@@ -541,6 +541,7 @@
+ #if defined(AF_INET6) && defined(IN6_IS_ADDR_V4MAPPED)
+ #define USE_IPV6
+ #endif
++#undef USE_IPV6
+ 
+ static int
+ open_client_socket( void )
	


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list