Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115572595
D41882.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
920 B
Referenced Files
None
Subscribers
None
D41882.diff
View Options
diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c
--- a/sbin/route/route_netlink.c
+++ b/sbin/route/route_netlink.c
@@ -271,22 +271,27 @@
hdr = snl_read_reply(ss, hdr->nlmsg_seq);
if (nl_type == NL_RTM_GETROUTE) {
- if (hdr->nlmsg_type == NL_RTM_NEWROUTE)
+ if (hdr->nlmsg_type == NL_RTM_NEWROUTE) {
print_getmsg(h, hdr, dst);
- else {
- snl_parse_errmsg(ss, hdr, &e);
- if (e.error == ESRCH)
- warn("route has not been found");
- else
- warn("message indicates error %d", e.error);
+ return (0);
}
-
- return (0);
}
- if (snl_parse_errmsg(ss, hdr, &e))
+ if (snl_parse_errmsg(ss, hdr, &e)) {
+ switch (e.error) {
+ case (ESRCH):
+ warnx("route has not been found");
+ break;
+ default:
+ if (e.error == 0)
+ break;
+ warnc(e.error, "message indicates error");
+ }
+
return (e.error);
+ }
}
+
return (EINVAL);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 12:40 PM (19 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17803992
Default Alt Text
D41882.diff (920 B)
Attached To
Mode
D41882: route(8): fix `route not found` exit code and warn with netlink
Attached
Detach File
Event Timeline
Log In to Comment