summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2013-06-11 01:01:15 +0000
committerdlg <dlg@openbsd.org>2013-06-11 01:01:15 +0000
commited08e427ca8ed490d8011d1ae81145def78dd17c (patch)
treefa2d6a5dd37106f0407bc3357ad4d1bb78d35d9c /sys
parentIf sysctl ddb.trigger=1 is not called from the console, the error (diff)
downloadwireguard-openbsd-ed08e427ca8ed490d8011d1ae81145def78dd17c.tar.xz
wireguard-openbsd-ed08e427ca8ed490d8011d1ae81145def78dd17c.zip
return ENOBUFS on failure from m_defrag and m_tag_copy_chain.
m_foo functions that return errors are now consistent as far as i can tell. ok bluhm@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_mbuf.c10
-rw-r--r--sys/kern/uipc_mbuf2.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index f48f043ce6e..1f367ef2348 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.171 2013/03/28 16:55:25 deraadt Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.172 2013/06/11 01:01:15 dlg Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -548,7 +548,7 @@ m_defrag(struct mbuf *m, int how)
struct mbuf *m0;
if (m->m_next == NULL)
- return 0;
+ return (0);
#ifdef DIAGNOSTIC
if (!(m->m_flags & M_PKTHDR))
@@ -556,12 +556,12 @@ m_defrag(struct mbuf *m, int how)
#endif
if ((m0 = m_gethdr(how, m->m_type)) == NULL)
- return -1;
+ return (ENOBUFS);
if (m->m_pkthdr.len > MHLEN) {
MCLGETI(m0, how, NULL, m->m_pkthdr.len);
if (!(m0->m_flags & M_EXT)) {
m_free(m0);
- return -1;
+ return (ENOBUFS);
}
}
m_copydata(m, 0, m->m_pkthdr.len, mtod(m0, caddr_t));
@@ -597,7 +597,7 @@ m_defrag(struct mbuf *m, int how)
m0->m_flags &= ~(M_EXT|M_CLUSTER); /* cluster is gone */
m_free(m0);
- return 0;
+ return (0);
}
/*
diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c
index dd954e78a74..090594c2352 100644
--- a/sys/kern/uipc_mbuf2.c
+++ b/sys/kern/uipc_mbuf2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf2.c,v 1.36 2013/02/07 11:06:42 mikeb Exp $ */
+/* $OpenBSD: uipc_mbuf2.c,v 1.37 2013/06/11 01:01:15 dlg Exp $ */
/* $KAME: uipc_mbuf2.c,v 1.29 2001/02/14 13:42:10 itojun Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */
@@ -355,7 +355,7 @@ m_tag_copy_chain(struct mbuf *to, struct mbuf *from, int wait)
t = m_tag_copy(p, wait);
if (t == NULL) {
m_tag_delete_chain(to);
- return (ENOMEM);
+ return (ENOBUFS);
}
if (tprev == NULL)
SLIST_INSERT_HEAD(&to->m_pkthdr.tags, t, m_tag_link);