summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2011-11-30 06:58:36 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2011-11-30 06:58:36 +0000
commitf80b3a3d825110b5d8826f72db3fa47a6d71b66a (patch)
tree445adc7972a781fc1ed03182f58c63c30819327b /cpukit
parent2011-11-30 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-f80b3a3d825110b5d8826f72db3fa47a6d71b66a.tar.bz2
2011-11-30 Ralf Corsépius <ralf.corsepius@rtems.org>
* librpc/src/rpc/clnt_udp.c (struct cu_data): Introduce unions _cu_inbuf, _cu_outbuf to avoid aliasing.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog5
-rw-r--r--cpukit/librpc/src/rpc/clnt_udp.c14
2 files changed, 16 insertions, 3 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 54b77fb356..4bbae755fc 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,10 @@
2011-11-30 Ralf Corsépius <ralf.corsepius@rtems.org>
+ * librpc/src/rpc/clnt_udp.c (struct cu_data):
+ Introduce unions _cu_inbuf, _cu_outbuf to avoid aliasing.
+
+2011-11-30 Ralf Corsépius <ralf.corsepius@rtems.org>
+
* libnetworking/rtems/rtems_dhcp.c (dhcp_init):
Remove unused var "len".
* score/src/objectinitializeinformation.c
diff --git a/cpukit/librpc/src/rpc/clnt_udp.c b/cpukit/librpc/src/rpc/clnt_udp.c
index aeace640a8..369da95f2d 100644
--- a/cpukit/librpc/src/rpc/clnt_udp.c
+++ b/cpukit/librpc/src/rpc/clnt_udp.c
@@ -88,9 +88,17 @@ struct cu_data {
XDR cu_outxdrs;
u_int cu_xdrpos;
u_int cu_sendsz; /* send size */
- char *cu_outbuf;
+ union {
+ u_int32_t *i32;
+ char *c;
+ } _cu_outbuf;
+#define cu_outbuf _cu_outbuf.c
u_int cu_recvsz; /* recv size */
- char cu_inbuf[1];
+ union {
+ u_int32_t *i32;
+ char c[1];
+ } _cu_inbuf;
+#define cu_inbuf _cu_inbuf.c
};
/*
@@ -352,7 +360,7 @@ send_again:
if (inlen < sizeof(u_int32_t))
continue;
/* see if reply transaction id matches sent id */
- if (*((u_int32_t *)(cu->cu_inbuf)) != *((u_int32_t *)(cu->cu_outbuf)))
+ if (*(cu->_cu_inbuf.i32) != *(cu->_cu_outbuf.i32))
continue;
/* we now assume we have the proper reply */
break;