aboutsummaryrefslogtreecommitdiff
path: root/src/libip
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2010-03-10 14:59:03 -0800
committerRuss Cox <rsc@swtch.com>2010-03-10 14:59:03 -0800
commit96898a81415df2368dfdbcf2b756982ba420a94f (patch)
tree3e7f69c937ca7ab208e9d61e45936b98dc048e91 /src/libip
parent0c9c620f39e56c42802504003fd05664aba670a4 (diff)
downloadplan9port-96898a81415df2368dfdbcf2b756982ba420a94f.tar.gz
plan9port-96898a81415df2368dfdbcf2b756982ba420a94f.tar.bz2
plan9port-96898a81415df2368dfdbcf2b756982ba420a94f.zip
more type-punned pointers
R=rsc http://codereview.appspot.com/376045
Diffstat (limited to 'src/libip')
-rw-r--r--src/libip/udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libip/udp.c b/src/libip/udp.c
index f318c4c3..ae413a24 100644
--- a/src/libip/udp.c
+++ b/src/libip/udp.c
@@ -46,8 +46,8 @@ udpwrite(int fd, Udphdr *hdr, void *buf, long n)
memset(&sin, 0, sizeof sin);
sin.sin_family = AF_INET;
- *(u32int*)&sin.sin_addr = *(u32int*)(hdr->raddr+12);
- *(u16int*)&sin.sin_port = *(u16int*)hdr->rport;
+ memmove(&sin.sin_addr, hdr->raddr+12, 4);
+ memmove(&sin.sin_port, hdr->rport, 2);
return sendto(fd, buf, n, 0, (struct sockaddr*)&sin, sizeof sin);
}