--- openswan-2.4.6+dfsg.2.orig/linux/net/ipsec/ipsec_init.c
+++ openswan-2.4.6+dfsg.2/linux/net/ipsec/ipsec_init.c
@@ -159,14 +159,22 @@
 static inline int
 openswan_inet_add_protocol(struct inet_protocol *prot, unsigned protocol)
 {
+#ifdef IPSKB_XFRM_TUNNEL_SIZE
+	inet_add_protocol(prot, protocol);
+#else
 	inet_add_protocol(prot);
+#endif
 	return 0;
 }
 
 static inline int
 openswan_inet_del_protocol(struct inet_protocol *prot, unsigned protocol)
 {
+#ifdef IPSKB_XFRM_TUNNEL_SIZE
+	inet_del_protocol(prot, protocol);
+#else
 	inet_del_protocol(prot);
+#endif
 	return 0;
 }
 
--- openswan-2.4.6+dfsg.2.orig/linux/net/ipsec/pfkey_v2.c
+++ openswan-2.4.6+dfsg.2/linux/net/ipsec/pfkey_v2.c
@@ -752,7 +752,7 @@
 			    "No sk attached to sock=0p%p.\n", sock);
 		return 0; /* -EINVAL; */
 	}
-		
+
 	KLIPS_PRINT(debug_pfkey,
 		    "klips_debug:pfkey_release: "
 		    "sock=0p%p sk=0p%p\n", sock, sk);
--- openswan-2.4.6+dfsg.2.orig/programs/fswcert/fswcert.c
+++ openswan-2.4.6+dfsg.2/programs/fswcert/fswcert.c
@@ -252,7 +252,7 @@
 			X509_free(x509);
 			break;
 
-		/* default: */
+		/*default:*/
 			/* other bag entry */
 	}
 	return error;
--- openswan-2.4.6+dfsg.2.orig/programs/pluto/pluto_crypt.c
+++ openswan-2.4.6+dfsg.2/programs/pluto/pluto_crypt.c
@@ -146,7 +146,7 @@
 
 void pluto_crypto_helper(int fd, int helpernum)
 {
-    char reqbuf[PCR_REQ_SIZE];
+    long reqbuf[PCR_REQ_SIZE/sizeof(long)];
     struct pluto_crypto_req *r;
 
     signal(SIGHUP, catchhup);
@@ -160,7 +160,7 @@
 			      , helpernum, fd));
 
     memset(reqbuf, 0, sizeof(reqbuf));
-    while(read(fd, reqbuf, sizeof(r->pcr_len)) == sizeof(r->pcr_len)) {
+    while(read(fd, (char*)reqbuf, sizeof(r->pcr_len)) == sizeof(r->pcr_len)) {
 	int restlen;
 	int actlen;
 
@@ -170,7 +170,7 @@
 	passert(restlen < (signed)PCR_REQ_SIZE);
 
 	/* okay, got a basic size, read the rest of it */
-	if((actlen= read(fd, reqbuf+sizeof(r->pcr_len), restlen)) != restlen) {
+	if((actlen= read(fd, ((char*)reqbuf)+sizeof(r->pcr_len), restlen)) != restlen) {
 	    /* faulty read. die, parent will restart us */
 	    
 	    loglog(RC_LOG_SERIOUS, "cryptographic helper(%d) read(%d)=%d failed: %s\n",
@@ -470,7 +470,7 @@
  */
 void handle_helper_comm(struct pluto_crypto_worker *w)
 {
-    char reqbuf[PCR_REQ_SIZE];
+    long reqbuf[PCR_REQ_SIZE/sizeof(long)];
     struct pluto_crypto_req *r;
     int restlen;
     int actlen;
@@ -484,7 +484,7 @@
 			   ,w->pcw_work));
 
     /* read from the pipe */
-    actlen = read(w->pcw_pipe, reqbuf, sizeof(r->pcr_len));
+    actlen = read(w->pcw_pipe, (char*)reqbuf, sizeof(r->pcr_len));
 
     if(actlen != sizeof(r->pcr_len)) {
 	if(actlen != 0) {
@@ -517,7 +517,7 @@
 	
     /* okay, got a basic size, read the rest of it */
     if((actlen= read(w->pcw_pipe
-		     , reqbuf+sizeof(r->pcr_len)
+		     , ((char*)reqbuf)+sizeof(r->pcr_len)
 		     , restlen)) != restlen) {
 	/* faulty read. die, parent will restart us */
 	

