summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/if_tun.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 98872dbc3ca..390a1b16ae3 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tun.c,v 1.91 2007/12/20 02:53:02 brad Exp $ */
+/* $OpenBSD: if_tun.c,v 1.92 2008/05/06 07:18:09 krw Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
@@ -551,6 +551,8 @@ tun_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
return (ether_output(ifp, m0, dst, rt));
M_PREPEND(m0, sizeof(*af), M_DONTWAIT);
+ if (m0 == NULL)
+ return (ENOBUFS);
af = mtod(m0, u_int32_t *);
*af = htonl(dst->sa_family);