-/* $OpenBSD: uipc_mbuf.c,v 1.3 1996/06/20 10:50:22 deraadt Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.4 1996/09/02 18:14:15 dm Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
extern vm_map_t mb_map;
struct mbuf *mbutl;
char *mclrefcnt;
+int needqueuedrain;
void
mbinit()
{
register struct mbuf *m;
+ if (i & M_DONTWAIT) {
+ needqueuedrain = 1;
+ setsoftnet ();
+ return (NULL);
+ }
m_reclaim();
#define m_retry(i, t) (struct mbuf *)0
MGET(m, i, t);
{
register struct mbuf *m;
+ if (i & M_DONTWAIT) {
+ needqueuedrain = 1;
+ setsoftnet ();
+ return (NULL);
+ }
m_reclaim();
#define m_retryhdr(i, t) (struct mbuf *)0
MGETHDR(m, i, t);
register struct protosw *pr;
int s = splimp();
+ needqueuedrain = 0;
for (dp = domains; dp; dp = dp->dom_next)
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_drain)
-/* $OpenBSD: ip_input.c,v 1.16 1996/08/14 07:50:13 deraadt Exp $ */
+/* $OpenBSD: ip_input.c,v 1.17 1996/09/02 18:14:19 dm Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
struct ipqent *ipqe;
int hlen, mff, s;
+ if (needqueuedrain)
+ m_reclaim ();
next:
/*
* Get next datagram off input queue and get IP header
-/* $OpenBSD: mbuf.h,v 1.2 1996/03/03 12:12:00 niklas Exp $ */
+/* $OpenBSD: mbuf.h,v 1.3 1996/09/02 18:14:21 dm Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
int max_hdr; /* largest link+protocol header */
int max_datalen; /* MHLEN - max_hdr */
extern int mbtypes[]; /* XXX */
+extern int needqueuedrain; /* True if allocation failed at */
+ /* interrupt level */
void mbinit __P((void));
struct mbuf *m_copym __P((struct mbuf *, int, int, int));