From 65e97594bd9ffe2fd77966373c16eb0015a4f2ae Mon Sep 17 00:00:00 2001 From: YASUOKA Masahiko Date: Sat, 18 Apr 2020 04:03:57 +0000 Subject: Use MHLEN for the space size of mbuf header. This fixes the panic when using pppac without pipex. ok dlg --- sys/net/if_pppx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/net/if_pppx.c') 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 @@ -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); -- cgit v1.2.3