From owner-freebsd-net Fri Oct 22 11: 3:59 1999 Delivered-To: freebsd-net@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id CEFB014C42; Fri, 22 Oct 1999 11:03:56 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.2/8.9.2) id LAA67886; Fri, 22 Oct 1999 11:03:42 -0700 (PDT) From: Archie Cobbs Message-Id: <199910221803.LAA67886@bubba.whistle.com> Subject: Re: SIOCGIFCONF (or qmail?) problem? In-Reply-To: <19991021193216.D86089@over.ru> from Alex Povolotsky at "Oct 21, 1999 07:32:16 pm" To: tarkhil@over.ru (Alex Povolotsky) Date: Fri, 22 Oct 1999 11:03:42 -0700 (PDT) Cc: freebsd-stable@FreeBSD.ORG, freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Alex Povolotsky writes: > I've just found, that bringing up ppp0 on a computer with one more network > interface causes qmail-1.03 to crash. > > Investigating further, I've found that one of qmail's internal variables > gets overwriten when calling ioctl SIOCGIFCONF with pointer to ifconf > structure as argument (ipme.c, line 57 in qmail). > > I still have not found if qmail gives wrong address to ioctl or if ioctl use > more memory than requested. The fail seems to occur after iterating through > ds0 interface. > > By the way, what is ds0, how it should be configured, and where is it > described? What does it do? > > Does anyone else runs FreeBSD 3.3-RELEASE with qmail and dial-in access? This may or may not be the problem, but there is a common bug in programs that use SIOCGIFCONF. The proper way to compute the byte increment to the next entry is: ifp = (struct ifreq *) ((char *) &ifp->ifr_addr + MAX(ifp->ifr_addr.sa_len, sizeof(ifp->ifr_addr)))) The WRONG way to do it is: ifp = (struct ifreq *) ((char *) &ifp->ifr_addr + ifp->ifr_addr.sa_len)) This bug usually only gets triggered when there are discard, tunnel, etc. interfaces which have no link information. You might plow through the qmail sources and check. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message