summaryrefslogtreecommitdiffstats
path: root/sys/net/if_mpe.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2018-01-09 15:24:24 +0000
committerbluhm <bluhm@openbsd.org>2018-01-09 15:24:24 +0000
commit809d3a3e7e4e2167dd03620b8ad7b0a18aaebb7d (patch)
treefd61749ec7d0159a6566d3b0d9a130710b6a29e5 /sys/net/if_mpe.c
parentChange `so_state' and `so_error' to unsigned int such that they can (diff)
downloadwireguard-openbsd-809d3a3e7e4e2167dd03620b8ad7b0a18aaebb7d.tar.xz
wireguard-openbsd-809d3a3e7e4e2167dd03620b8ad7b0a18aaebb7d.zip
Creating a cloned interface could return ENOMEM due to temporary
memory shortage. As it is invoked from a system call, it should not fail and wait instead. OK visa@ mpi@
Diffstat (limited to 'sys/net/if_mpe.c')
-rw-r--r--sys/net/if_mpe.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c
index 28cf41e99bb..e15c821bb00 100644
--- a/sys/net/if_mpe.c
+++ b/sys/net/if_mpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mpe.c,v 1.63 2017/11/29 19:36:03 claudio Exp $ */
+/* $OpenBSD: if_mpe.c,v 1.64 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -81,10 +81,7 @@ mpe_clone_create(struct if_clone *ifc, int unit)
struct ifnet *ifp;
struct mpe_softc *mpeif;
- if ((mpeif = malloc(sizeof(*mpeif),
- M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return (ENOMEM);
-
+ mpeif = malloc(sizeof(*mpeif), M_DEVBUF, M_WAITOK|M_ZERO);
mpeif->sc_unit = unit;
ifp = &mpeif->sc_if;
snprintf(ifp->if_xname, sizeof ifp->if_xname, "mpe%d", unit);