summaryrefslogtreecommitdiff
path: root/sys
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
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')
-rw-r--r--sys/net/route.c10
-rw-r--r--sys/net/rtsock.c8
2 files changed, 8 insertions, 10 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;
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 52f2ac36eb5..80c53bc2ff7 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.154 2014/12/11 08:55:10 mpi Exp $ */
+/* $OpenBSD: rtsock.c,v 1.155 2014/12/19 18:57:17 bluhm Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -750,11 +750,9 @@ report:
newgate = 1;
}
if (info.rti_info[RTAX_GATEWAY] != NULL &&
- rt_setgate(rt, rt_key(rt),
- info.rti_info[RTAX_GATEWAY], tableid)) {
- error = EDQUOT;
+ (error = rt_setgate(rt, rt_key(rt),
+ info.rti_info[RTAX_GATEWAY], tableid)))
goto flush;
- }
/*
* new gateway could require new ifaddr, ifp;
* flags may also be different; ifp may be specified