From owner-freebsd-net@FreeBSD.ORG Tue Feb 13 14:42:58 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E1D416A402 for ; Tue, 13 Feb 2007 14:42:58 +0000 (UTC) (envelope-from mav@alkar.net) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 8F44E13C471 for ; Tue, 13 Feb 2007 14:42:56 +0000 (UTC) (envelope-from mav@alkar.net) Received: from [212.86.226.11] (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.0.11) with ESMTPA id 20779764; Tue, 13 Feb 2007 16:42:55 +0200 Message-ID: <45D1CE6F.1050505@alkar.net> Date: Tue, 13 Feb 2007 16:42:55 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8b) Gecko/20051108 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <21be38170702130035n4ee69773mddc07a2b674fb81a@mail.gmail.com> <45D194EB.10008@alkar.net> <21be38170702130321t23345ce0pe298733be438d6b0@mail.gmail.com> <45D1A6D3.8060301@alkar.net> <20070213133017.A47107@maildrop.int.zabbadoz.net> In-Reply-To: <20070213133017.A47107@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, Andrew Bliznak Subject: Re: Mpd-4.1 released X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2007 14:42:58 -0000 Bjoern A. Zeeb wrote: > --- 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 @@ > > /* 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; > + } > > This change is not needed. ng_l2tp_xmit_ctrl() does this already. It does this usually. But in case of no free mbufs it does not. Usually it's ok. But in this case it will lead to assertion in next check. The other way is to schedule next timeout, but in lack of system resources it can be better to just skip this packet. > It's not a good idea to remove the L2TP_SEQ_CHECK()s. It is _incorrect_ to call it there. When ng_l2tp_seq_xack_timeout() called callout_pending() function will already return FALSE because of timeout already ended. But at this moment action is not actually done and seq->xack != seq->nr. This leads to KASSERT without any reason. > Been there years ago but seems I missed to get this fixed > in the FreeBSD repo. > The problem is in ng_l2tp_seq_check(). Fix it there. Problem is not there! ng_l2tp_seq_check() works correctly from it's point of view. -- Alexander Motin mav@alkar.net Optima Telecom