forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2011-11-30 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
* libnetworking/rtems/rtems_dhcp.c (dhcp_init):
|
* libnetworking/rtems/rtems_dhcp.c (dhcp_init):
|
||||||
|
|||||||
@@ -88,9 +88,17 @@ struct cu_data {
|
|||||||
XDR cu_outxdrs;
|
XDR cu_outxdrs;
|
||||||
u_int cu_xdrpos;
|
u_int cu_xdrpos;
|
||||||
u_int cu_sendsz; /* send size */
|
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 */
|
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))
|
if (inlen < sizeof(u_int32_t))
|
||||||
continue;
|
continue;
|
||||||
/* see if reply transaction id matches sent id */
|
/* 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;
|
continue;
|
||||||
/* we now assume we have the proper reply */
|
/* we now assume we have the proper reply */
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user