Subject: Re: Sendmail delivery funny
To: Julian Coleman <jdc@coris.demon.co.uk>
From: None <itojun@iijlab.net>
List: current-users
Date: 11/06/2000 08:57:41
>> 	please provide the folloing information.
>> 	- what do you mean by "TTL 0"?
>tcpdump shows :
>  18:30:56.735349 coris.demon.co.uk.49269 > tele-post-20.mail.demon.net.smtp: S [tcp sum ok] 1004049898:1004049898(0) win 16384 <mss 1484> [ttl 0] (id 3455)

	i see.  could you please try the following patch?  sorry for the mess.

>> 	- show us the result of "netstat -an" during the delayed connection.
>> 	  (otherwise, you are not sure if the first trial is to IPv6
>> 	  destination or not)
>Well, I wasn't 100% sure, but ktrace of sendmail showed :
>  10567 sendmail CALL  socket(0x18,0x1,0)
>  10567 sendmail RET   socket 6
>  10567 sendmail CALL  __sigprocmask14(0x1,0,0x82b88)
>  10567 sendmail RET   __sigprocmask14 0
>  10567 sendmail CALL  __sigaltstack14(0,0xefffa950)
>  10567 sendmail RET   __sigaltstack14 0
>  10567 sendmail CALL  connect(0x6,0xefffaa78,0x1c)
>  10567 sendmail RET   connect -1 errno 60 Connection timed out
>  10567 sendmail CALL  close(0x6)
>for each failed connection and domain 0x18 is INET6.  As soon as it does :
>  10567 sendmail CALL  socket(0x2,0x1,0)
>the mail gets sent.
>`netstat -an` shows (lots of output but I assumed you're interested in) :
>  tcp6       0      0  ::ffff:212.228.1.49344 ::ffff:194.217.2.25    SYN_SENT
>Also, `fstat` shows :
>  root     sendmail   11032    8* internet6 stream tcp f0429600 [::ffff:212.228.127.249]:49344 <-> [::ffff:194.217.242.92]:25

	this is called "IPv4 mapped IPv6 address", and the real connection goes
	to 194.217.242.92.  this has nothing to do with IPv6 on the wire
	(it uses AF_INET6 API, but the actual wire protocol used is IPv4).
	i should have disabled this API behavior...

itojun


Index: tcp_output.c
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/tcp_output.c,v
retrieving revision 1.61
diff -u -r1.61 tcp_output.c
--- tcp_output.c	2000/10/19 20:23:00	1.61
+++ tcp_output.c	2000/11/05 23:57:24
@@ -976,6 +976,12 @@
 #ifdef INET6
 		else if (tp->t_in6pcb) {
 			ip->ip_ttl = tp->t_in6pcb->in6p_ip6.ip6_hlim;
+			/*
+			 * XXX ip6_hlim can be 0 if there's no IPv6
+			 * configuration
+			 */
+			if (ip->ip_ttl == 0)
+				ip->ip_ttl = ip_defttl;
 			ip->ip_tos = 0;	/*XXX*/
 		}
 #endif