From nobody@FreeBSD.org  Fri Feb 22 02:33:59 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39F6916A400
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Feb 2008 02:33:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B21813C45B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Feb 2008 02:33:59 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1M2VNQS044934
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Feb 2008 02:31:24 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m1M2VNFW044933;
	Fri, 22 Feb 2008 02:31:23 GMT
	(envelope-from nobody)
Message-Id: <200802220231.m1M2VNFW044933@www.freebsd.org>
Date: Fri, 22 Feb 2008 02:31:23 GMT
From: James Snow <snow@teardrop.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 7.x 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         120958
>Category:       kern
>Synopsis:       no response to ICMP traffic on interface configured with a link-local address
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    gnn
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 22 02:40:02 UTC 2008
>Closed-Date:    Thu Sep 25 18:57:55 UTC 2008
>Last-Modified:  Thu Sep 25 18:57:55 UTC 2008
>Originator:     James Snow
>Release:        7.0-RC1 & 7.0-RC2
>Organization:
>Environment:
FreeBSD zfs.teardrop.org 7.0-RC1 FreeBSD 7.0-RC1 #18: Sat Feb  2 15:08:42 UTC 2008     snow@zfs.teardrop.org:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
In sys/netinet/ip_icmp.c at line 625, this bit of code:

        if (!in_canforward(ip->ip_src) &&
            ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) !=
             (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))) {
                m_freem(m);     /* Bad return address */
                icmpstat.icps_badaddr++;
                goto done;      /* Ip_output() will check for broadcast */
        }

Causes the system to not respond to any ICMP traffic on any interface
configured with a link-local address (169.254/16).
>How-To-Repeat:
ifconfig lo1 create
ifconfig lo1 inet 169.254.1.1 netmask 255.255.0.0
ping 169.254.1.1
>Fix:
Unknown, but I believe bms@freebsd.org has a fix in mind.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bms 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Feb 22 07:59:16 UTC 2008 
Responsible-Changed-Why:  
Submitter notest that bms had taken an interest in the problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120958 
Responsible-Changed-From-To: bms->freebsd-net 
Responsible-Changed-By: bms 
Responsible-Changed-When: Fri 22 Feb 2008 21:23:23 UTC 
Responsible-Changed-Why:  
The secretary disavows all knowledge of your actions. 
["Responsible" implies "I'll fix it", I said no such thing.. I *MIGHT* 
get around to it, but "Responsible" implies there's an obligation. 
Cheeky linimon!] 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120958 

From: James Snow <snow@teardrop.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/120958: no response to ICMP traffic on interface configured with a link-local address
Date: Thu, 13 Mar 2008 20:23:55 -0400

 --IS0zKkzwUGydFO0o
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Attached is a patch that reworks the problematic if statement in
 sys/netinet/ip_icmp.c and adds two new macros to sys/netinet/in.h.
 This fixes the problem, and eliminates a duplicate check for loopback
 addresses.  (Although it introduces some redundant ntohl() calls.)
 
 
 -Snow
 
 
 --IS0zKkzwUGydFO0o
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="link-local-icmp.patch"
 
 diff -ru /usr/src/sys/netinet/in.h /usr/src.new/sys/netinet/in.h
 --- /usr/src/sys/netinet/in.h	2007-06-12 16:24:53.000000000 +0000
 +++ /usr/src.new/sys/netinet/in.h	2008-03-13 10:44:29.000000000 +0000
 @@ -379,6 +379,8 @@
  #define	IN_BADCLASS(i)		(((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
  
  #define IN_LINKLOCAL(i)		(((u_int32_t)(i) & 0xffff0000) == 0xa9fe0000)
 +#define IN_LOOPBACK(i)		(((u_int32_t)(i) & 0xff000000) == 0x7f000000)
 +#define IN_ZERONET(i)		(((u_int32_t)(i) & 0xff000000) == 0)
  
  #define	IN_PRIVATE(i)	((((u_int32_t)(i) & 0xff000000) == 0x0a000000) || \
  			 (((u_int32_t)(i) & 0xfff00000) == 0xac100000) || \
 diff -ru /usr/src/sys/netinet/ip_icmp.c /usr/src.new/sys/netinet/ip_icmp.c
 --- /usr/src/sys/netinet/ip_icmp.c	2007-10-07 20:44:23.000000000 +0000
 +++ /usr/src.new/sys/netinet/ip_icmp.c	2008-03-13 11:03:44.000000000 +0000
 @@ -622,13 +622,14 @@
  	struct mbuf *opts = 0;
  	int optlen = (ip->ip_hl << 2) - sizeof(struct ip);
  
 -	if (!in_canforward(ip->ip_src) &&
 -	    ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) !=
 -	     (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))) {
 +	if (IN_MULTICAST(ntohl(ip->ip_src.s_addr)) ||
 +	    IN_EXPERIMENTAL(ntohl(ip->ip_src.s_addr)) ||
 +	    IN_ZERONET(ntohl(ip->ip_src.s_addr)) ) {
  		m_freem(m);	/* Bad return address */
  		icmpstat.icps_badaddr++;
  		goto done;	/* Ip_output() will check for broadcast */
  	}
 +
  	t = ip->ip_dst;
  	ip->ip_dst = ip->ip_src;
  
 
 --IS0zKkzwUGydFO0o--
State-Changed-From-To: open->patched 
State-Changed-By: gnn 
State-Changed-When: Thu Apr 17 12:51:46 UTC 2008 
State-Changed-Why:  
User submitted a patch which is now applied and tested. 

Take over bug until closed. 


Responsible-Changed-From-To: freebsd-net->gnn 
Responsible-Changed-By: gnn 
Responsible-Changed-When: Thu Apr 17 12:51:46 UTC 2008 
Responsible-Changed-Why:  
The user's suggested patch has been applied. 

Take the bug over until its closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120958 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/120958: commit references a PR
Date: Thu, 17 Apr 2008 12:50:53 +0000 (UTC)

 gnn         2008-04-17 12:50:43 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/netinet          in.h ip_icmp.c 
   Log:
   Clean up the code that checks the types of address so that it is
   done by understandable macros.
   
   Fix the bug that prevented the system from responding on interfaces with
   link local addresses assigned.
   
   PR: 120958
   Submitted by: James Snow <snow at teardrop.org>
   MFC after: 2 weeks
   
   Revision  Changes    Path
   1.102     +2 -0      src/sys/netinet/in.h
   1.121     +4 -3      src/sys/netinet/ip_icmp.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/120958: commit references a PR
Date: Thu, 17 Apr 2008 23:25:10 +0000 (UTC)

 gnn         2008-04-17 23:24:58 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/netinet          ip_icmp.c 
   Log:
   Add in check for loopback as well, which was missing from the original patch.
   
   PR: 120958
   Submitted by: James Snow <snow at teardrop.org>
   MFC after: 2 weeks
   
   Revision  Changes    Path
   1.122     +1 -0      src/sys/netinet/ip_icmp.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: gnn 
State-Changed-When: Thu Sep 25 18:57:14 UTC 2008 
State-Changed-Why:  
Fix is now in HEAD and will be in 7.1 when released. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120958 
>Unformatted:
