-/* $OpenBSD: uipc_mbuf.c,v 1.203 2015/04/13 08:45:48 mpi Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.204 2015/05/31 20:10:44 bluhm Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
void
ml_join(struct mbuf_list *mla, struct mbuf_list *mlb)
{
- if (mla->ml_tail == NULL)
- *mla = *mlb;
- else if (mlb->ml_tail != NULL) {
- mla->ml_tail->m_nextpkt = mlb->ml_head;
+ if (!ml_empty(mlb)) {
+ if (ml_empty(mla))
+ mla->ml_head = mlb->ml_head;
+ else
+ mla->ml_tail->m_nextpkt = mlb->ml_head;
mla->ml_tail = mlb->ml_tail;
mla->ml_len += mlb->ml_len;