File openswan_04_build_fixes.dif of Package openswan
--- programs/pluto/connections.c
+++ programs/pluto/connections.c 2008/09/04 18:15:07
@@ -323,10 +323,12 @@ delete_connection(struct connection *c,
gw_delref(&c->gw_info);
#ifdef KERNEL_ALG
- alg_info_delref((struct alg_info **)&c->alg_info_esp);
+ struct alg_info *pespi = (struct alg_info *)c->alg_info_esp;
+ alg_info_delref((struct alg_info **)&pespi);
#endif
#ifdef IKE_ALG
- alg_info_delref((struct alg_info **)&c->alg_info_ike);
+ struct alg_info *pikei = (struct alg_info *)c->alg_info_ike;
+ alg_info_delref((struct alg_info **)&pikei);
#endif
pfree(c);
}
@@ -578,9 +580,9 @@ format_end(char *buf
if(dohost_name) {
if(this->host_addr_name) {
- strncat(host_space, "<", sizeof(host_space)-1);
- strncat(host_space, this->host_addr_name, sizeof(host_space)-1);
- strncat(host_space, ">", sizeof(host_space));
+ strncat(host_space, "<", sizeof(host_space)-strlen(host_space)-1);
+ strncat(host_space, this->host_addr_name, sizeof(host_space)-strlen(host_space)-1);
+ strncat(host_space, ">", sizeof(host_space)-strlen(host_space)-1);
}
}
--- programs/pluto/demux.c
+++ programs/pluto/demux.c 2008/09/04 18:09:55
@@ -228,7 +228,7 @@ static bool
read_packet(struct msg_digest *md)
{
const struct iface_port *ifp = md->iface;
- int packet_len;
+ ssize_t packet_len;
/* ??? this buffer seems *way* too big */
u_int8_t bigbuffer[MAX_INPUT_UDP_SIZE];
#ifdef NAT_TRAVERSAL
@@ -278,7 +278,7 @@ read_packet(struct msg_digest *md)
from_ugh = undisclosed;
}
else if (from_len
- < (int) (offsetof(struct sockaddr, sa_family) + sizeof(from.sa.sa_family)))
+ < (offsetof(struct sockaddr, sa_family) + sizeof(from.sa.sa_family)))
{
from_ugh = "truncated";
}