diff options
author | brian <brian@cvs.openbsd.org> | 2000-05-07 10:12:15 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 2000-05-07 10:12:15 +0000 |
commit | d622259e9ff2e9f8d1432684ef4941d04fef2ee3 (patch) | |
tree | c95e32e6f461af37dcfdc2adbcdfb5e57d9b434d /usr.sbin | |
parent | 00a96fea39a7c6b840b66afb17b40242f1ea3e86 (diff) |
Correct a bad bug in m_prepend()
Submitted by: luoqi@FreeBSD.org
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/mbuf.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/ppp/ppp/mbuf.c b/usr.sbin/ppp/ppp/mbuf.c index 40f769b0517..54c91c51425 100644 --- a/usr.sbin/ppp/ppp/mbuf.c +++ b/usr.sbin/ppp/ppp/mbuf.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $OpenBSD: mbuf.c,v 1.11 2000/03/03 21:52:57 brian Exp $ + * $OpenBSD: mbuf.c,v 1.12 2000/05/07 10:12:14 brian Exp $ * */ #include <sys/types.h> @@ -401,8 +401,10 @@ m_settype(struct mbuf *bp, int type) } struct mbuf * -m_append(struct mbuf *m, const void *v, size_t sz) +m_append(struct mbuf *bp, const void *v, size_t sz) { + struct mbuf *m = bp; + if (m) { while (m->m_next) m = m->m_next; @@ -411,7 +413,7 @@ m_append(struct mbuf *m, const void *v, size_t sz) else m->m_next = m_prepend(NULL, v, sz, 0); } else - m = m_prepend(NULL, v, sz, 0); + bp = m_prepend(NULL, v, sz, 0); - return m; + return bp; } |