summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-09-11 09:05:32 +0200
committerTom Rix <Tom.Rix@windriver.com>2009-10-03 09:04:21 -0500
commite35c73d7e19e6ea45efcaf807736277afee9c7d1 (patch)
tree19990af775655e3127b3f2d3826358fb5e5d348b
parentfd37a0d04e339267b5d2872e9e6ee6650f122367 (diff)
downloadu-boot-imx-e35c73d7e19e6ea45efcaf807736277afee9c7d1.zip
u-boot-imx-e35c73d7e19e6ea45efcaf807736277afee9c7d1.tar.gz
u-boot-imx-e35c73d7e19e6ea45efcaf807736277afee9c7d1.tar.bz2
net/bootp.c: fix compile warning
Fix warning: bootp.c:695: warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Ben Warren <biggerbadderben@gmail.com>
-rw-r--r--net/bootp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bootp.c b/net/bootp.c
index 0799ae2..3093852 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -683,6 +683,9 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
{
uchar *end = popt + BOOTP_HDR_SIZE;
int oplen, size;
+#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
+ int *to_ptr;
+#endif
while (popt < end && *popt != 0xff) {
oplen = *(popt + 1);
@@ -692,7 +695,8 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
break;
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
case 2: /* Time offset */
- NetCopyLong ((ulong *)&NetTimeOffset, (ulong *) (popt + 2));
+ to_ptr = &NetTimeOffset;
+ NetCopyLong ((ulong *)to_ptr, (ulong *)(popt + 2));
NetTimeOffset = ntohl (NetTimeOffset);
break;
#endif