Re: [XFRM] Set SA saddr correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 28, 2003 at 11:12:17PM +1000, herbert wrote:
> The source address of an SA is not necessarily equal to the source address
> in the selector.  This patch addresses this problem.

Oops, I missed the copy back into userspace.  Here is the corrected patch.
-- 
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/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.6
diff -u -r1.6 xfrm_user.c
--- kernel-source-2.5/net/xfrm/xfrm_user.c	28 Jun 2003 00:28:01 -0000	1.6
+++ kernel-source-2.5/net/xfrm/xfrm_user.c	29 Jun 2003 00:05:51 -0000
@@ -200,7 +200,7 @@
 	x->props.replay_window = p->replay_window;
 	x->props.reqid = p->reqid;
 	x->props.family = p->family;
-	x->props.saddr = x->sel.saddr;
+	x->props.saddr = p->saddr;
 }
 
 static struct xfrm_state *xfrm_state_construct(struct xfrm_usersa_info *p,
@@ -296,6 +296,7 @@
 	memcpy(&p->lft, &x->lft, sizeof(p->lft));
 	memcpy(&p->curlft, &x->curlft, sizeof(p->curlft));
 	memcpy(&p->stats, &x->stats, sizeof(p->stats));
+	p->saddr = x->props.saddr;
 	p->mode = x->props.mode;
 	p->replay_window = x->props.replay_window;
 	p->reqid = x->props.reqid;
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.2
diff -u -r1.2 xfrm.h
--- kernel-source-2.5/include/linux/xfrm.h	28 Jun 2003 00:27:55 -0000	1.2
+++ kernel-source-2.5/include/linux/xfrm.h	28 Jun 2003 13:09:13 -0000
@@ -155,6 +155,7 @@
 struct xfrm_usersa_info {
 	struct xfrm_selector		sel;
 	struct xfrm_id			id;
+	xfrm_address_t			saddr;
 	struct xfrm_lifetime_cfg	lft;
 	struct xfrm_lifetime_cur	curlft;
 	struct xfrm_stats		stats;

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux