[IPSEC]: Add encapsulation family.
authorMiika Komu <miika@iki.fi>
Fri, 1 Dec 2006 00:40:43 +0000 (16:40 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:31:48 +0000 (21:31 -0800)
Signed-off-by: Miika Komu <miika@iki.fi>
Signed-off-by: Diego Beltrami <Diego.Beltrami@hiit.fi>
Signed-off-by: Kazunori Miyazawa <miyazawa@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/xfrm/xfrm_policy.c

index 984e5c45265c44e9ed9fcca42fbe6c98bc3de383..15ec19dcf9c886864374a044e636c941ab8e0903 100644 (file)
@@ -310,6 +310,8 @@ struct xfrm_tmpl
 /* Source address of tunnel. Ignored, if it is not a tunnel. */
        xfrm_address_t          saddr;
 
+       unsigned short          encap_family;
+
        __u32                   reqid;
 
 /* Mode: transport, tunnel etc. */
index e5ea1347a4ffbcaaf536285877fb3043dc82d00d..64d3938f74c46d1d13753c32a3b37da63fd27918 100644 (file)
@@ -1211,6 +1211,7 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, struct flowi *fl,
                if (tmpl->mode == XFRM_MODE_TUNNEL) {
                        remote = &tmpl->id.daddr;
                        local = &tmpl->saddr;
+                       family = tmpl->encap_family;
                        if (xfrm_addr_any(local, family)) {
                                error = xfrm_get_saddr(&tmp, remote, family);
                                if (error)