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 10:10:06 +0200
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20050214221433.GB18465@xxxxxxxxxxxxxxxxxxx>
References: <20050214221006.GA18415@xxxxxxxxxxxxxxxxxxx> <20050214221200.GA18465@xxxxxxxxxxxxxxxxxxx> <20050214221433.GB18465@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:

This patch adds a pointer to the route corresponding to the specific
flow over the SA of an xfrm_dst that's being used.

It also sets the next pointer of each xfrm_dst to the one above it.
This allows to traverse the list upwards from the bottom.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Cheers,
------------------------------------------------------------------------
/* Decapsulation state, used by the input to store data during
===== net/ipv4/xfrm4_policy.c 1.14 vs edited =====
--- 1.14/net/ipv4/xfrm4_policy.c        2005-02-14 14:02:13 +11:00
+++ edited/net/ipv4/xfrm4_policy.c      2005-02-14 14:29:35 +11:00
@@ -55,18 +55,29 @@
        struct rtable *rt = rt0;
        u32 remote = fl->fl4_dst;
        u32 local  = fl->fl4_src;
+       struct flowi fl_tunnel = {
+               .nl_u = {
+                       .ip4_u = {
+                               .saddr = local,
+                               .daddr = remote
+                       }
+               }
+       };
        int i;
        int err;
        int header_len = 0;
        int trailer_len = 0;

        dst = dst_prev = NULL;

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;

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