Skip to content
Snippets Groups Projects
Commit e35c73d7 authored by Wolfgang Denk's avatar Wolfgang Denk Committed by Tom Rix
Browse files

net/bootp.c: fix compile warning


Fix warning: bootp.c:695: warning: dereferencing type-punned pointer
will break strict-aliasing rules

Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
Cc: Ben Warren <biggerbadderben@gmail.com>
parent fd37a0d0
No related branches found
No related tags found
No related merge requests found
...@@ -683,6 +683,9 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp) ...@@ -683,6 +683,9 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
{ {
uchar *end = popt + BOOTP_HDR_SIZE; uchar *end = popt + BOOTP_HDR_SIZE;
int oplen, size; int oplen, size;
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
int *to_ptr;
#endif
while (popt < end && *popt != 0xff) { while (popt < end && *popt != 0xff) {
oplen = *(popt + 1); oplen = *(popt + 1);
...@@ -692,7 +695,8 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp) ...@@ -692,7 +695,8 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
break; break;
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET) #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
case 2: /* Time offset */ case 2: /* Time offset */
NetCopyLong ((ulong *)&NetTimeOffset, (ulong *) (popt + 2)); to_ptr = &NetTimeOffset;
NetCopyLong ((ulong *)to_ptr, (ulong *)(popt + 2));
NetTimeOffset = ntohl (NetTimeOffset); NetTimeOffset = ntohl (NetTimeOffset);
break; break;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment