diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2010-09-08 08:53:58 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2010-09-08 08:53:58 +0000 |
commit | 50032937c2097cd06bb28d3378d963fa870a0053 (patch) | |
tree | 20aae5c86183467a571620a418848af69d898afb | |
parent | 276c0f482291e1afa9f8f322e04c20fe05a1a40e (diff) |
creating a pfsync interface is always done from process context, so
we can pass M_WAITOK to malloc(9) (which was already done a few lines
down, which set off my aesthetic alarm).
While here, include malloc.h, since we're calling malloc.
ok dlg@
-rw-r--r-- | sys/net/if_pfsync.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index c711d8b04af..36bcee04360 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.154 2010/07/28 06:52:05 dlg Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.155 2010/09/08 08:53:57 blambert Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -46,6 +46,7 @@ #include <sys/proc.h> #include <sys/systm.h> #include <sys/time.h> +#include <sys/malloc.h> #include <sys/mbuf.h> #include <sys/socket.h> #include <sys/ioctl.h> @@ -278,6 +279,7 @@ pfsyncattach(int npfsync) { if_clone_attach(&pfsync_cloner); } + int pfsync_clone_create(struct if_clone *ifc, int unit) { @@ -290,9 +292,7 @@ pfsync_clone_create(struct if_clone *ifc, int unit) pfsync_sync_ok = 1; - sc = malloc(sizeof(*pfsyncif), M_DEVBUF, M_NOWAIT | M_ZERO); - if (sc == NULL) - return (ENOMEM); + sc = malloc(sizeof(*pfsyncif), M_DEVBUF, M_WAITOK | M_ZERO); for (q = 0; q < PFSYNC_S_COUNT; q++) TAILQ_INIT(&sc->sc_qs[q]); |