mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-01-10 12:18:55 +00:00
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>
This commit is contained in:
parent
fd37a0d04e
commit
e35c73d7e1
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue