Hi: This patch adds an inner family field to all userspace structures for SAs and templates. This is needed to allow the creation of IPv4 in IPv6 and IPv6 in IPv4 SAs. I also took the opportunity to remove the family field from the userspace policy structures as they are now redundant due to the new family field in the selector. This patch breaks ABI for NETLINK users. That is why I'd like to do this as soon as possible. Of course, we still need to write the code that uses these things :) Cheers, -- Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ ) Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Index: kernel-source-2.5/include/linux/xfrm.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/include/linux/xfrm.h,v retrieving revision 1.6 diff -u -r1.6 xfrm.h --- kernel-source-2.5/include/linux/xfrm.h 26 Jul 2003 03:56:01 -0000 1.6 +++ kernel-source-2.5/include/linux/xfrm.h 6 Aug 2003 22:29:21 -0000 @@ -37,6 +37,7 @@ __u16 dport_mask; __u16 sport; __u16 sport_mask; + __u16 family; __u8 prefixlen_d; __u8 prefixlen_s; __u8 proto; @@ -125,6 +126,7 @@ struct xfrm_user_tmpl { struct xfrm_id id; + __u16 family; xfrm_address_t saddr; __u32 reqid; __u8 mode; @@ -189,7 +191,6 @@ struct xfrm_lifetime_cur curlft; __u32 priority; __u32 index; - __u16 family; __u8 dir; __u8 action; #define XFRM_POLICY_ALLOW 0 Index: kernel-source-2.5/net/xfrm/xfrm_user.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/xfrm/xfrm_user.c,v retrieving revision 1.12 diff -u -r1.12 xfrm_user.c --- kernel-source-2.5/net/xfrm/xfrm_user.c 3 Aug 2003 04:45:39 -0000 1.12 +++ kernel-source-2.5/net/xfrm/xfrm_user.c 6 Aug 2003 22:34:43 -0000 @@ -527,7 +527,7 @@ return -EINVAL; }; - switch (p->family) { + switch (p->sel.family) { case AF_INET: break; @@ -594,7 +594,7 @@ memcpy(&xp->lft, &p->lft, sizeof(xp->lft)); xp->action = p->action; xp->flags = p->flags; - xp->family = p->family; + xp->family = p->sel.family; /* XXX xp->share = p->share; */ } @@ -605,7 +605,7 @@ memcpy(&p->curlft, &xp->curlft, sizeof(p->curlft)); p->priority = xp->priority; p->index = xp->index; - p->family = xp->family; + p->sel.family = xp->family; p->dir = dir; p->action = xp->action; p->flags = xp->flags;