Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Sep 2001 02:50:01 -0700 (PDT)
From:      Dima Dorfman <dima@unixfreak.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/30524: 4.4-RC4: panic in icmp_reflect [WITH PATCH] 
Message-ID:  <200109170950.f8H9o1n82012@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/30524; it has been noted by GNATS.

From: Dima Dorfman <dima@unixfreak.org>
To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
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 <wollman@khavrinen.lcs.mit.edu> wrote:
 > <<On Thu, 13 Sep 2001 04:50:02 -0700 (PDT), Dima Dorfman <dima@unixfreak.org>
 >  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109170950.f8H9o1n82012>