--- ng_l2tp.c.orig Sat Feb 10 06:58:03 2007 +++ ng_l2tp.c Sat Feb 10 06:58:00 2007 @@ -1121,6 +1121,10 @@ hpriv->stats.xmitPackets++; hpriv->stats.xmitOctets += m->m_pkthdr.len; + /* And the global one. */ + priv->stats.xmitPackets++; + priv->stats.xmitOctets += m->m_pkthdr.len; + /* Send packet */ NG_FWD_NEW_DATA(error, item, priv->lower, m); return (error); @@ -1398,12 +1402,13 @@ const priv_p priv = NG_NODE_PRIVATE(node); struct l2tp_seq *const seq = &priv->seq; - /* Sanity check */ - L2TP_SEQ_CHECK(seq); - /* If ack is still outstanding, send a ZLB */ - if (seq->xack != seq->nr) + if (seq->xack != seq->nr) { ng_l2tp_xmit_ctrl(priv, NULL, seq->ns); + /* If there was memory error, ignore it. + We must keep state consistent here. */ + seq->xack = seq->nr; + } /* Done */ L2TP_SEQ_CHECK(seq); @@ -1420,9 +1425,6 @@ struct l2tp_seq *const seq = &priv->seq; struct mbuf *m; u_int delay; - - /* Sanity check */ - L2TP_SEQ_CHECK(seq); /* Make sure peer's ack is still outstanding before doing anything */ if (seq->rack == seq->ns)