Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jul 2009 13:22:55 GMT
From:      "Alexander V. Chernikov" <melifaro@ipfw.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/136661: ndp ignores -f option
Message-ID:  <200907111322.n6BDMt7P075858@www.freebsd.org>
Resent-Message-ID: <200907111330.n6BDU2f5032805@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         136661
>Category:       bin
>Synopsis:       ndp ignores -f option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 11 13:30:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Alexander V. Chernikov
>Release:        8.0-CURRENT
>Organization:
>Environment:
FreeBSD ws.ipfw.ru 8.0-CURRENT FreeBSD 8.0-CURRENT #6: Sat Jun 20 20:59:45 MSD 2009     root@ws.ipfw.ru:/usr/obj/usr/src/sys/WS  amd64

>Description:
According to ndp(8) manpage and ndp usage() -f flags can be used to make ndp parse file with ndp entries.

There is getopt "f:" option and file() function in ndp.c,
but there is no dispatcher of 'f' mode in second switch {}
>How-To-Repeat:
ktrace -tn ndp -f /dev/null ; kdump | grep /dev/null
>Fix:
Apply attached patch

Patch attached with submission follows:

--- usr.sbin/ndp/ndp.c.orig	2009-07-11 17:12:43.000000000 +0400
+++ usr.sbin/ndp/ndp.c	2009-07-11 17:14:35.000000000 +0400
@@ -246,6 +246,8 @@
 		}
 		delete(arg);
 		break;
+	case 'f':
+		exit(file(arg) ? 1 : 0);
 	case 'I':
 #ifdef SIOCSDEFIFACE_IN6	/* XXX: check SIOCGDEFIFACE_IN6 as well? */
 		if (argc > 1) {


>Release-Note:
>Audit-Trail:
>Unformatted:



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