From 6ea0e199591352d01c238473018501b45ba05f17 Mon Sep 17 00:00:00 2001 From: luoqi Date: Wed, 21 Apr 1999 21:28:01 +0000 Subject: [PATCH] Work around an egcs optimizer bug (i386). This should fix the active ftp hang problem. A bug report has been sent to cygnus. --- lib/libalias/alias_util.c | 6 ++++-- sys/netinet/libalias/alias_util.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libalias/alias_util.c b/lib/libalias/alias_util.c index fe0765312018..cb948c3385f6 100644 --- a/lib/libalias/alias_util.c +++ b/lib/libalias/alias_util.c @@ -43,7 +43,8 @@ PacketAliasInternetChecksum(u_short *ptr, int nbytes) if (nbytes == 1) { oddbyte = 0; - *((u_char *) &oddbyte) = *(u_char *) ptr; + ((u_char *) &oddbyte)[0] = *(u_char *) ptr; + ((u_char *) &oddbyte)[1] = 0; sum += oddbyte; } sum = (sum >> 16) + (sum & 0xffff); @@ -84,7 +85,8 @@ TcpChecksum(struct ip *pip) if (nbytes == 1) { oddbyte = 0; - *((u_char *) &oddbyte) = *(u_char *) ptr; + ((u_char *) &oddbyte)[0] = *(u_char *) ptr; + ((u_char *) &oddbyte)[1] = 0; sum += oddbyte; } diff --git a/sys/netinet/libalias/alias_util.c b/sys/netinet/libalias/alias_util.c index fe0765312018..cb948c3385f6 100644 --- a/sys/netinet/libalias/alias_util.c +++ b/sys/netinet/libalias/alias_util.c @@ -43,7 +43,8 @@ PacketAliasInternetChecksum(u_short *ptr, int nbytes) if (nbytes == 1) { oddbyte = 0; - *((u_char *) &oddbyte) = *(u_char *) ptr; + ((u_char *) &oddbyte)[0] = *(u_char *) ptr; + ((u_char *) &oddbyte)[1] = 0; sum += oddbyte; } sum = (sum >> 16) + (sum & 0xffff); @@ -84,7 +85,8 @@ TcpChecksum(struct ip *pip) if (nbytes == 1) { oddbyte = 0; - *((u_char *) &oddbyte) = *(u_char *) ptr; + ((u_char *) &oddbyte)[0] = *(u_char *) ptr; + ((u_char *) &oddbyte)[1] = 0; sum += oddbyte; }