Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2007 16:42:55 +0200
From:      Alexander Motin <mav@alkar.net>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
Cc:        freebsd-net@freebsd.org, Andrew Bliznak <andriko.b@gmail.com>
Subject:   Re: Mpd-4.1 released
Message-ID:  <45D1CE6F.1050505@alkar.net>
In-Reply-To: <20070213133017.A47107@maildrop.int.zabbadoz.net>
References:  <21be38170702130035n4ee69773mddc07a2b674fb81a@mail.gmail.com> <45D194EB.10008@alkar.net> <21be38170702130321t23345ce0pe298733be438d6b0@mail.gmail.com> <45D1A6D3.8060301@alkar.net> <20070213133017.A47107@maildrop.int.zabbadoz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45D1CE6F.1050505>