From nobody@FreeBSD.org  Mon Jun 13 06:39:29 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 525CE16A41C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 13 Jun 2005 06:39:29 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2F84443D49
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 13 Jun 2005 06:39:29 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j5D6dSno006956
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 13 Jun 2005 06:39:28 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j5D6dSZC006955;
	Mon, 13 Jun 2005 06:39:28 GMT
	(envelope-from nobody)
Message-Id: <200506130639.j5D6dSZC006955@www.freebsd.org>
Date: Mon, 13 Jun 2005 06:39:28 GMT
From: SAKAI Hiroaki <sakai.hiroaki@finet.fujitsu.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ndp command bug
X-Send-Pr-Version: www-2.3

>Number:         82185
>Category:       bin
>Synopsis:       [patch] ndp(8) can delete the incorrect entry
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 13 06:40:02 GMT 2005
>Closed-Date:    
>Last-Modified:  Sat Jan 16 21:08:53 UTC 2010
>Originator:     SAKAI Hiroaki
>Release:        FreeBSD-4.10
>Organization:
FINET
>Environment:
FreeBSD newface.finet.fujitsu.co.jp 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Wed Jun 16 11:12:16 JST 2004     hsakai@newface.finet.fujitsu.co.jp:/usr/src/sys/compile/NEWFACE  i386
>Description:
If we specify non-NDP entry on ndp command, longest-match NDP entry is deleted.

>How-To-Repeat:
# netstat -r -W | grep fec0 | grep link
fec0::                        link#2                        UC          0        0   1500     fxp1
# ndp -d fec0::1:1:1:1
fec0::1:1:1:1 (fec0::) deleted
# netstat -r -W | grep fec0 | grep link
#

>Fix:
FreeBSD-4.11 and FreeBSD-5.4
/usr/src/usr.sbin/ndp/ndp.c:delete()

         if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) {
                 if (sdl->sdl_family == AF_LINK &&
                     (rtm->rtm_flags & RTF_LLINFO) &&
                     !(rtm->rtm_flags & RTF_GATEWAY)) {
                         goto delete;
                 }
                 /*
                  * IPv4 arp command retries with sin_other = SIN_PROXY here.
                  */
                 fprintf(stderr, "delete: cannot delete non-NDP entry\n");
                 return 1;
         }
+        fprintf(stderr, "delete: can't locate %s\n",host);
+                 return 1;

 delete:
         if (sdl->sdl_family != AF_LINK) {
                 printf("cannot locate %s\n", host);
                 return (1);
         }

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sat Jan 16 21:06:40 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s) 

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