mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-25 11:37:56 +00:00
Print human-readable error for "route not found" case.
Submitted by: vsevolod (initial version) MFC after: 2 weeks Sponsored by: Yandex LLC
This commit is contained in:
parent
f5196a58a0
commit
ad4278e8fd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273906
@ -1533,9 +1533,18 @@ rtmsg(int cmd, int flags, int fib)
|
||||
if (debugonly)
|
||||
return (0);
|
||||
if ((rlen = write(s, (char *)&m_rtmsg, l)) < 0) {
|
||||
if (errno == EPERM)
|
||||
switch (errno) {
|
||||
case EPERM:
|
||||
err(1, "writing to routing socket");
|
||||
warn("writing to routing socket");
|
||||
case ESRCH:
|
||||
warnx("route has not been found");
|
||||
break;
|
||||
case EEXIST:
|
||||
/* Handled by newroute() */
|
||||
break;
|
||||
default:
|
||||
warn("writing to routing socket");
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
if (cmd == RTM_GET) {
|
||||
|
Loading…
Reference in New Issue
Block a user