diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 2f19a61c774..b9f1c185f4a 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -345,6 +345,7 @@ static __inline void m_clget(struct mbuf *m, int how); static __inline void *m_cljget(struct mbuf *m, int how, int size); static __inline void m_chtype(struct mbuf *m, short new_type); void mb_free_ext(struct mbuf *); +static __inline struct mbuf *m_last(struct mbuf *m); static __inline int m_gettype(int size) @@ -579,6 +580,15 @@ m_chtype(struct mbuf *m, short new_type) m->m_type = new_type; } +static __inline struct mbuf * +m_last(struct mbuf *m) +{ + + while (m->m_next) + m = m->m_next; + return (m); +} + /* * mbuf, cluster, and external object allocation macros (for compatibility * purposes).