summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias/alias_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/libalias/alias_util.c')
-rw-r--r--sys/netinet/libalias/alias_util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/libalias/alias_util.c b/sys/netinet/libalias/alias_util.c
index fe07653..cb948c3 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;
}
OpenPOWER on IntegriCloud