mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 10:19:26 +00:00
Respect -q with "add" and "delete". Document who respects -q.
PR: bin/38531
This commit is contained in:
parent
fc482908be
commit
999ffea58a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97278
@ -73,7 +73,11 @@ to forget this, especially when attempting to repair networking operations).
|
|||||||
.It Fl v
|
.It Fl v
|
||||||
(verbose) Print additional details.
|
(verbose) Print additional details.
|
||||||
.It Fl q
|
.It Fl q
|
||||||
Suppress all output.
|
Suppress all output from the
|
||||||
|
.Cm add , delete ,
|
||||||
|
and
|
||||||
|
.Cm flush
|
||||||
|
commands.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
|
@ -784,38 +784,39 @@ newroute(argc, argv)
|
|||||||
}
|
}
|
||||||
if (*cmd == 'g')
|
if (*cmd == 'g')
|
||||||
exit(0);
|
exit(0);
|
||||||
oerrno = errno;
|
if (!qflag) {
|
||||||
(void) printf("%s %s %s", cmd, ishost? "host" : "net", dest);
|
oerrno = errno;
|
||||||
if (*gateway) {
|
(void) printf("%s %s %s", cmd, ishost? "host" : "net", dest);
|
||||||
(void) printf(": gateway %s", gateway);
|
if (*gateway) {
|
||||||
if (attempts > 1 && ret == 0 && af == AF_INET)
|
(void) printf(": gateway %s", gateway);
|
||||||
(void) printf(" (%s)",
|
if (attempts > 1 && ret == 0 && af == AF_INET)
|
||||||
inet_ntoa(((struct sockaddr_in *)&route.rt_gateway)->sin_addr));
|
(void) printf(" (%s)",
|
||||||
}
|
inet_ntoa(((struct sockaddr_in *)&route.rt_gateway)->sin_addr));
|
||||||
if (ret == 0) {
|
}
|
||||||
(void) printf("\n");
|
if (ret == 0) {
|
||||||
exit(0);
|
(void) printf("\n");
|
||||||
} else {
|
} else {
|
||||||
switch (oerrno) {
|
switch (oerrno) {
|
||||||
case ESRCH:
|
case ESRCH:
|
||||||
err = "not in table";
|
err = "not in table";
|
||||||
break;
|
break;
|
||||||
case EBUSY:
|
case EBUSY:
|
||||||
err = "entry in use";
|
err = "entry in use";
|
||||||
break;
|
break;
|
||||||
case ENOBUFS:
|
case ENOBUFS:
|
||||||
err = "routing table overflow";
|
err = "routing table overflow";
|
||||||
break;
|
break;
|
||||||
case EDQUOT: /* handle recursion avoidance in rt_setgate() */
|
case EDQUOT: /* handle recursion avoidance in rt_setgate() */
|
||||||
err = "gateway uses the same route";
|
err = "gateway uses the same route";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err = strerror(oerrno);
|
err = strerror(oerrno);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
(void) printf(": %s\n", err);
|
||||||
}
|
}
|
||||||
(void) printf(": %s\n", err);
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
exit(ret != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user