From owner-freebsd-bugs Mon Sep 17 2:50:10 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9C56B37B401 for ; Mon, 17 Sep 2001 02:50:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f8H9o1n82012; Mon, 17 Sep 2001 02:50:01 -0700 (PDT) (envelope-from gnats) Date: Mon, 17 Sep 2001 02:50:01 -0700 (PDT) Message-Id: <200109170950.f8H9o1n82012@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Dima Dorfman Subject: Re: kern/30524: 4.4-RC4: panic in icmp_reflect [WITH PATCH] Reply-To: Dima Dorfman 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 The following reply was made to PR kern/30524; it has been noted by GNATS. From: Dima Dorfman To: Garrett Wollman Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: kern/30524: 4.4-RC4: panic in icmp_reflect [WITH PATCH] Date: Mon, 17 Sep 2001 02:49:31 -0700 Garrett Wollman wrote: > < > said: > > > Unforunately, the commit log doesn't provide any rationale for the > > change, just reassurance that it probably doesn't break anything. > > Garrett (cc'd), can you provide any insight on this? > > The standard requires that hosts accept broadcasts and multicasts > while unconfigured, just as they are supposed to be able to send them > (with source address 0.0.0.0). 4.2BSD got this wrong. This was one > of the issues in the way of correct DHCP client operation without > requiring BPF. Okay, please review the attached patch for the icmp case. It's adpated from NetBSD, who have been using it for three years. It fixes the case described in this PR and the one in 29337. Thanks. Index: ip_icmp.c =================================================================== RCS file: /ref/cvsf/src/sys/netinet/ip_icmp.c,v retrieving revision 1.59 diff -u -r1.59 ip_icmp.c --- ip_icmp.c 3 Sep 2001 20:03:54 -0000 1.59 +++ ip_icmp.c 17 Sep 2001 09:46:46 -0000 @@ -624,9 +624,22 @@ /* * The following happens if the packet was not addressed to us, * and was received on an interface with no IP address. + * We find the first address on the first non-loopback + * interface in the hope of it having a route back to the + * source. */ if (ia == (struct in_ifaddr *)0) - ia = TAILQ_FIRST(&in_ifaddrhead); + TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) + if (!(ia->ia_ifp->if_flags & IFF_LOOPBACK)) + break; + /* + * If we still don't have an address, punt. We probably have + * an interface up and receiving packets with no addresses. + */ + if (ia == (struct in_ifaddr *)0) { + m_freem(m); + goto done; + } t = IA_SIN(ia)->sin_addr; ip->ip_src = t; ip->ip_ttl = ip_defttl; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message