summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/route/route.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 9b3bb95..21d92b5 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -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) {
OpenPOWER on IntegriCloud