From owner-freebsd-bugs Tue Jan 14 3:30:10 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62B2A37B405 for ; Tue, 14 Jan 2003 03:30:06 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A3D043F18 for ; Tue, 14 Jan 2003 03:30:05 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h0EBU5NS061416 for ; Tue, 14 Jan 2003 03:30:05 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h0EBU5JT061415; Tue, 14 Jan 2003 03:30:05 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95AE037B401 for ; Tue, 14 Jan 2003 03:27:49 -0800 (PST) Received: from workhorse.imach.com (barbwire.iMach.com [206.127.77.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3C0F43EB2 for ; Tue, 14 Jan 2003 03:27:48 -0800 (PST) (envelope-from forrestc@workhorse.imach.com) Received: (from forrestc@localhost) by workhorse.imach.com (8.11.6/8.11.6) id h0EBRi092030; Tue, 14 Jan 2003 04:27:47 -0700 (MST) (envelope-from forrestc) Message-Id: <200301141127.h0EBRi092030@workhorse.imach.com> Date: Tue, 14 Jan 2003 04:27:47 -0700 (MST) From: "Forrest W. Christian" To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/47044: Sendmail "Can't assign requested addresses" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 47044 >Category: bin >Synopsis: Sendmail "Can't assign requested addresses" >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 14 03:30:04 PST 2003 >Closed-Date: >Last-Modified: >Originator: Forrest W. Chritian >Release: FreeBSD 4.7-STABLE i386 >Organization: Montana Internet Corporation >Environment: System: FreeBSD relay.mt.net 4.7-STABLE FreeBSD 4.7-STABLE #7: Tue Jan 14 18:45:13 GMT 2003 root@relay.mt.net:/usr/src/sys/compile/MAIL i386 This is on a multiprocessor box. IPv6 has tried both compiled into the kernel, and not. IPv6 has been both enabled and disabled in rc.conf. >Description: For some reason, the following code snippet from the daemon.c source file in /usr/src/contrib/sendmail/src results in a corrupted address in the clt_addr.sin.sin_addr.s_addr field on my system, along with clt_bind being set to true, which indicates the code *thinks* it got a valid address. --------------- clt_bind = false; /* Set up the address for outgoing connection. */ if (bitnset(D_BINDIF, d_flags) && (p = macvalue(macid("{if_addr}"), e)) != NULL && *p != '\0') { #if NETINET6 char p6[INET6_ADDRSTRLEN]; #endif /* NETINET6 */ memset(&clt_addr, '\0', sizeof clt_addr); /* infer the address family from the address itself */ clt_addr.sa.sa_family = addr_family(p); switch (clt_addr.sa.sa_family) { #if NETINET case AF_INET: clt_addr.sin.sin_addr.s_addr = inet_addr(p); if (clt_addr.sin.sin_addr.s_addr != INADDR_NONE && clt_addr.sin.sin_addr.s_addr != INADDR_LOOPBACK) { clt_bind = true; socksize = sizeof (struct sockaddr_in); } break; #endif /* NETINET */ #if NETINET6 case AF_INET6: if (inet_addr(p) != INADDR_NONE) (void) sm_snprintf(p6, sizeof p6, "IPv6:::ffff:%s", p); else (void) sm_strlcpy(p6, p, sizeof p6); if (anynet_pton(AF_INET6, p6, &clt_addr.sin6.sin6_addr) == 1 && !IN6_IS_ADDR_LOOPBACK(&clt_addr.sin6.sin6_addr)) { clt_bind = true; socksize = sizeof (struct sockaddr_in6); } break; #endif /* NETINET6 */ #if 0 default: syserr("554 5.3.5 Address= option unsupported for family %d", clt_addr.sa.sa_family); break; #endif /* 0 */ } if (clt_bind) family = clt_addr.sa.sa_family; } ------------------- As stands, this results in sendmail failing when doing a queue run, getting errors like: ------------ relay# sendmail -v -qRmtha.org Running /var/spool/mqueue/h0E9KMnX000089 (sequence 1 of 108) ... Connecting to mail.mtha.org. via esmtp... makeconnection: cannot bind socket [209.181.34.149]: Can't assign requested address ... Connecting to mail.mt.net. via esmtp... makeconnection: cannot bind socket [209.181.34.149]: Can't assign requested address ... Deferred: Can't assign requested address Running /var/spool/mqueue/h0E9KMnV000089 (sequence 2 of 108) ... Deferred: Can't assign requested address ------------- 209.181.34.149 varies from run to run (although seems to be consistent for several runs in a row, then it changes). 209.181.34.149 is *not* any address here and is *not* associated with the domains in question. On occasion the code works as designed. I have also tried changing -DINET6 to -DINET in the sendmail makefile to verify that it isn't IPV6 code specific. No changes. I have worked around the issue by adding a clt_bind=0; statement at the end of the code snipplet above, which forces the next section of code to disregard the corrupted address and refill the fields. >How-To-Repeat: Easily repeatable on my installation. First time I've seen it. System was originally running earlier (>6months old) copy of FreeBSD-Stable, and had same issues. May just be a subtle configuration error. Willing to work with appropriate FreeBSD/Sendmail team members to help reproduce or fix the problem. I am unsure if this is a FreeBSD library bug or a sendmail bug, thus the freebsd-pr (as I'm more active in the FreeBSD community than the sendmail one). >Fix: Unknown. >Release-Note: >Audit-Trail: >Unformatted: Sendmail "Can't assign requested addresses" From: Forrest W. Christian Reply-To: Forrest W. Christian Cc: X-send-pr-version: 3.113 X-GNATS-Notify: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message