diff options
author | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2020-04-18 04:03:57 +0000 |
---|---|---|
committer | YASUOKA Masahiko <yasuoka@cvs.openbsd.org> | 2020-04-18 04:03:57 +0000 |
commit | 65e97594bd9ffe2fd77966373c16eb0015a4f2ae (patch) | |
tree | c1b862da813f27ff9ad1b691b6d87a0e20f0f0bd /sys/net/if_pppx.c | |
parent | df2ee33b35fad002c2728cb9b290d73b395abd4d (diff) |
Use MHLEN for the space size of mbuf header. This fixes the panic
when using pppac without pipex.
ok dlg
Diffstat (limited to 'sys/net/if_pppx.c')
-rw-r--r-- | sys/net/if_pppx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index 7f03cb515f9..4dcbe1d5695 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.83 2020/04/10 07:36:52 mpi Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.84 2020/04/18 04:03:56 yasuoka Exp $ */ /* * Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org> @@ -344,7 +344,7 @@ pppxwrite(dev_t dev, struct uio *uio, int ioflag) if (m == NULL) return (ENOBUFS); mlen = MHLEN; - if (uio->uio_resid >= MINCLSIZE) { + if (uio->uio_resid > MHLEN) { MCLGET(m, M_DONTWAIT); if (!(m->m_flags & M_EXT)) { m_free(m); @@ -1368,7 +1368,7 @@ pppacwrite(dev_t dev, struct uio *uio, int ioflag) if (m == NULL) return (ENOMEM); - if (uio->uio_resid > MINCLSIZE) { + if (uio->uio_resid > MHLEN) { m_clget(m, M_WAITOK, uio->uio_resid); if (!ISSET(m->m_flags, M_EXT)) { m_free(m); |