On Wed, Apr 28, 2021 at 03:19:47AM +0300, Vitaliy Makkoveev wrote:
> The code not only breaks loop but also cleans the queue. Should this be
> kept?

In IPv6 nd6_cache_lladdr() we have neither queue nor loop, just a
single mbuf on hold.  But we have that discard logic, too.

                        if (ln->ln_hold) {
                                struct mbuf *n = ln->ln_hold;
                                ln->ln_hold = NULL;
                                /*
                                 * we assume ifp is not a p2p here, so just
                                 * set the 2nd argument as the 1st one.
                                 */
                                ifp->if_output(ifp, n, rt_key(rt), rt);
                                if (ln->ln_hold == n) {
                                        /* n is back in ln_hold. Discard. */
                                        m_freem(ln->ln_hold);
                                        ln->ln_hold = NULL;
                                }
                        }

So I guess there is a reason to clean up.

bluhm

Reply via email to