[Openswan dev] [PATCH][CVS-1.X] gcc4 fixes for klips

Vinay K Nallamothu vinay.nallamothu at gsecone.com
Sun Apr 10 17:12:11 CEST 2005


Hi,

My previous patches didn't include the "lvalue assignment error" fixes
for klips. Including them below. Tested and seems to work fine for me.
Applies against the latest in CVS.

Thanks
Vinay

 ipsec_radij.c     |    5 ++++-
 ipsec_rcv.c       |    3 ++-
 pfkey_v2_parser.c |    5 ++++-
 3 files changed, 10 insertions(+), 3 deletions(-)
============================================================================================================
diff -urN openswan-1.0.9/klips/net/ipsec/ipsec_radij.c openswan-1.0.9-m/klips/net/ipsec/ipsec_radij.c
--- openswan-1.0.9/klips/net/ipsec/ipsec_radij.c	2004-06-17 14:17:11.000000000 +0530
+++ openswan-1.0.9-m/klips/net/ipsec/ipsec_radij.c	2005-04-10 15:30:46.657923928 +0530
@@ -260,7 +260,10 @@
 	retrt->er_pid = pid;
 	retrt->er_count = 0;
 	retrt->er_lasttime = jiffies/HZ;
-	rd_key((&(retrt->er_rjt))) = &(retrt->er_eaddr);
+	{
+		struct sockaddr_encap **rkeyp = (struct sockaddr_encap**)&((retrt->er_rjt).rd_nodes->rj_key);
+		*rkeyp = &(retrt->er_eaddr);
+	}
 	
 	if (ident_s && ident_s->type != SADB_IDENTTYPE_RESERVED) {
 		int data_len = ident_s->len * IPSEC_PFKEYv2_ALIGN - sizeof(struct sadb_ident);
diff -urN openswan-1.0.9/klips/net/ipsec/ipsec_rcv.c openswan-1.0.9-m/klips/net/ipsec/ipsec_rcv.c
--- openswan-1.0.9/klips/net/ipsec/ipsec_rcv.c	2003-12-04 08:34:38.000000000 +0530
+++ openswan-1.0.9-m/klips/net/ipsec/ipsec_rcv.c	2005-04-10 15:30:46.660923472 +0530
@@ -1723,7 +1724,8 @@
 		skb_pull(skb, iphlen);
 
 #ifdef NET_21
-		ipp = (struct iphdr *)skb->nh.raw = skb->data;
+		skb->nh.raw = skb->data;
+		ipp = (struct iphdr *)skb->nh.raw;
 		skb->h.raw = skb->nh.raw + (skb->nh.iph->ihl << 2);
 		
 		memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
diff -urN openswan-1.0.9/klips/net/ipsec/pfkey_v2_parser.c openswan-1.0.9-m/klips/net/ipsec/pfkey_v2_parser.c
--- openswan-1.0.9/klips/net/ipsec/pfkey_v2_parser.c	2003-11-19 07:59:41.000000000 +0530
+++ openswan-1.0.9-m/klips/net/ipsec/pfkey_v2_parser.c	2005-04-10 15:30:46.582935328 +0530
@@ -456,7 +456,10 @@
 				    s->sa_family);
 			SENDERR(EPFNOSUPPORT);
 		}
-		(unsigned int)(*sap) = ((struct sockaddr_in*)s)->sin_addr.s_addr;
+		{
+			unsigned int *sapp = (unsigned int*)sap;
+			*sapp = ((struct sockaddr_in*)s)->sin_addr.s_addr;
+		}
 		if (portp != 0)
 			*portp = ((struct sockaddr_in*)s)->sin_port;
 #ifdef CONFIG_IPSEC_DEBUG

==============================================================================================================
-- 
Views expressed in this mail are those of the individual sender and 
do not bind Gsec1 Limited. or its subsidiary, unless the sender has done
so expressly with due authority of Gsec1.
_________________________________________________________________________




More information about the Dev mailing list