summaryrefslogtreecommitdiff
path: root/sys/net/route.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2014-12-19 18:57:18 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2014-12-19 18:57:18 +0000
commit54309686695cb771bdda488e5e113ef42905657e (patch)
tree80636af8daae92619ead0e2ba62f4c9b7b69743b /sys/net/route.c
parentb8d60590925ff4d90f40cabc1e46d870ec01e28e (diff)
Do not report an EDQUOT "Disk quota exceeded" error from the routing
code. Instead generate an ENOBUFS "No buffer space available" error at the malloc(9) failure in rt_setgate(9) and propagate it. OK mpi@
Diffstat (limited to 'sys/net/route.c')
-rw-r--r--sys/net/route.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index b933dd0ed8f..d6b616be00d 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.194 2014/12/08 10:46:14 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.195 2014/12/19 18:57:17 bluhm Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -834,10 +834,10 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio,
prio = ifa->ifa_ifp->if_priority + RTP_STATIC;
rt->rt_priority = prio; /* init routing priority */
LIST_INIT(&rt->rt_timer);
- if (rt_setgate(rt, info->rti_info[RTAX_DST],
- info->rti_info[RTAX_GATEWAY], tableid)) {
+ if ((error = rt_setgate(rt, info->rti_info[RTAX_DST],
+ info->rti_info[RTAX_GATEWAY], tableid))) {
pool_put(&rtentry_pool, rt);
- senderr(ENOBUFS);
+ senderr(error);
}
ndst = rt_key(rt);
if (info->rti_info[RTAX_NETMASK] != NULL) {
@@ -997,7 +997,7 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate,
old = (caddr_t)rt_key(rt);
new = malloc(dlen + glen, M_RTABLE, M_NOWAIT);
if (new == NULL)
- return 1;
+ return (ENOBUFS);
rt->rt_nodes->rn_key = new;
} else {
new = rt->rt_nodes->rn_key;