Jeremie Courreges-Anglas <[email protected]> writes:

> Mike Belopuhov <[email protected]> writes:
>
>> Good day, Dimitris.
>>
>> Long time ago in a galaxy far far away I've been using this
>> alongside the -F option that I've added.  While managed
>> switches are becoming cheaper, I don't see a reason for a
>> working feature to go away, especially since there has been
>> zero rationale provided apart from "ndp -f" doesn't work.
>> Well, then how about fixing ndp?
> [...]
>
> Diff below, seems to work fine.

Now with the manpage improvements initially proposed by Dimitris.
I have kept my ndp.c diff, because it is more consistent with the style
of the rest of the file.  Dimitris's diff points out that main() never
reports failures (exit(0)), it would be nice to fix.

ok?

Index: ndp.8
===================================================================
RCS file: /cvs/src/usr.sbin/ndp/ndp.8,v
retrieving revision 1.35
diff -u -p -r1.35 ndp.8
--- ndp.8       5 Oct 2015 10:25:19 -0000       1.35
+++ ndp.8       31 Mar 2016 16:49:53 -0000
@@ -117,6 +117,12 @@ Delete the specified NDP entry.
 .It Fl f Ar filename
 Parse the file specified by
 .Ar filename .
+Entries in the file should be of the form:
+.Bd -ragged -offset indent -compact
+.Ar nodename etheraddr
+.Op Ar temp
+.Op Ar proxy
+.Ed
 .It Fl H
 Harmonize consistency between the routing table and the default router
 list; install the top entry of the list into the kernel routing table.
Index: ndp.c
===================================================================
RCS file: /cvs/src/usr.sbin/ndp/ndp.c,v
retrieving revision 1.69
diff -u -p -r1.69 ndp.c
--- ndp.c       26 Jan 2016 18:26:19 -0000      1.69
+++ ndp.c       31 Mar 2016 16:49:53 -0000
@@ -241,6 +241,11 @@ main(int argc, char *argv[])
                }
                delete(arg);
                break;
+       case 'f':
+               if (argc != 0)
+                       usage();
+               file(arg);
+               break;
        case 'p':
                if (argc != 0) {
                        usage();


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to