-.\" $OpenBSD: route.9,v 1.13 2014/11/01 21:45:54 mpi Exp $
+.\" $OpenBSD: route.9,v 1.14 2014/12/19 18:57:17 bluhm Exp $
.\"
.\" Copyright (c) 2011 Bret S. Lambert <blambert@openbsd.org>
.\" All rights reserved.
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: November 1 2014 $
+.Dd $Mdocdate: December 19 2014 $
.Dt ROUTE 9
.Os
.Sh NAME
.El
.Sh RETURN VALUES
.Fn rt_setgate
-returns non-0 if it cannot allocate memory.
+may fail with:
+.Pp
+.Bl -tag -width Er -compact
+.It Bq Er ENOBUFS
+Memory could not be allocated for the gateway.
+.El
.Pp
.Fn rtdeletemsg
may fail with:
-/* $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 $ */
/*
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) {
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;
-/* $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 $ */
/*
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