ip/ipconfig: set ndb database file with -f argument
This commit is contained in:
parent
4dfcb4791b
commit
a4650bdf83
2 changed files with 12 additions and 2 deletions
|
@ -18,6 +18,8 @@ ipconfig, rip, linklocal, ipv6on \- Internet configuration and routing
|
|||
.IR mtu ]
|
||||
.RB [ -o
|
||||
.IR dhcp-opt ]
|
||||
.RB [ -f
|
||||
.IR dbfile ]
|
||||
.RB [ -x
|
||||
.IR netmtpt ]
|
||||
[
|
||||
|
@ -227,6 +229,10 @@ disable IPv6 duplicate discovery detection,
|
|||
which removes any existing ARP table entry for one of our IPv6 addresses
|
||||
before adding new ones.
|
||||
.TP
|
||||
.B f
|
||||
use the ndb database file
|
||||
.I dbfile .
|
||||
.TP
|
||||
.B x
|
||||
use the IP stack mounted at
|
||||
.I netmtpt
|
||||
|
|
|
@ -149,6 +149,7 @@ Ctl *firstctl, **ctll;
|
|||
Ipifc *ifc;
|
||||
int ipv6auto = 0;
|
||||
int myifc = -1;
|
||||
char *dbfile;
|
||||
char *ndboptions;
|
||||
int nip;
|
||||
int noconfig;
|
||||
|
@ -226,7 +227,7 @@ usage(void)
|
|||
{
|
||||
fprint(2, "usage: %s [-6dDGnNOpPruX][-b baud][-c ctl]* [-g gw]"
|
||||
"[-h host][-m mtu]\n"
|
||||
"\t[-x mtpt][-o dhcpopt] type dev [verb] [laddr [mask "
|
||||
"\t[-f dbfile][-x mtpt][-o dhcpopt] type dev [verb] [laddr [mask "
|
||||
"[raddr [fs [auth]]]]]\n", argv0);
|
||||
exits("usage");
|
||||
}
|
||||
|
@ -519,6 +520,9 @@ main(int argc, char **argv)
|
|||
case 'D':
|
||||
debug = 1;
|
||||
break;
|
||||
case 'f':
|
||||
dbfile = EARGF(usage());
|
||||
break;
|
||||
case 'g':
|
||||
if (parseip(conf.gaddr, EARGF(usage())) == -1)
|
||||
usage();
|
||||
|
@ -1823,7 +1827,7 @@ ndbconfig(void)
|
|||
Ndb *db;
|
||||
Ndbtuple *t, *nt;
|
||||
|
||||
db = ndbopen(0);
|
||||
db = ndbopen(dbfile);
|
||||
if(db == nil)
|
||||
sysfatal("can't open ndb: %r");
|
||||
if (strcmp(conf.type, "ether") != 0 && strcmp(conf.type, "gbe") != 0 ||
|
||||
|
|
Loading…
Reference in a new issue