netdev
[Top] [All Lists]

Re: [3/4] [IPSEC] Add route element to xfrm_dst

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [3/4] [IPSEC] Add route element to xfrm_dst
From: Mika Penttilä <mika.penttila@xxxxxxxxxxx>
Date: Tue, 15 Feb 2005 12:22:18 +0200
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20050215095346.GA21999@xxxxxxxxxxxxxxxxxxx>
References: <20050214221006.GA18415@xxxxxxxxxxxxxxxxxxx> <20050214221200.GA18465@xxxxxxxxxxxxxxxxxxx> <20050214221433.GB18465@xxxxxxxxxxxxxxxxxxx> <4211AE5E.2010506@xxxxxxxxxxx> <20050215095346.GA21999@xxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020
Herbert Xu wrote:

On Tue, Feb 15, 2005 at 10:10:06AM +0200, Mika Penttil? wrote:
Shouldn't this pinning happen inside the loop for eaxh xdst, to be balanced with the dst_release(xdst->route) in xfrm_dst_destroy ?

+       dst_hold(&rt->u.dst);

        for (i = 0; i < nx; i++) {
                struct dst_entry *dst1 = dst_alloc(&xfrm4_dst_ops);
+               struct xfrm_dst *xdst;

                if (unlikely(dst1 == NULL)) {
                        err = -ENOBUFS;

There is a dst_release here.

The reference is either released here if the allocation fails, or it
is held by dst1 which is either returned or freed as part of the bundle.

Cheers,
ok I see now, thanks

Mika


<Prev in Thread] Current Thread [Next in Thread>