summaryrefslogtreecommitdiffstats
path: root/include/net.h
diff options
context:
space:
mode:
authorSergey Temerkhanov <s.temerkhanov@gmail.com>2015-04-08 01:41:22 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:35 -0600
commit5917e7d165d4a66d724631c196cf307485769821 (patch)
tree27eb6e1b25fb97fe7f92342fd77b24d3d1e7d2ba /include/net.h
parentbc0571fc1067ff8a8fd16990ae65c1a2826ea90c (diff)
downloadblackbird-obmc-uboot-5917e7d165d4a66d724631c196cf307485769821.tar.gz
blackbird-obmc-uboot-5917e7d165d4a66d724631c196cf307485769821.zip
net: Fix incorrect DHCP/BOOTP packets on 64-bit systems
This commit fixes incorrect DHCP/BOOTP packet layout caused by 'ulong' type size difference on 64 and 32-bit architectures. It also renames NetReadLong()/NetCopyLong() to net_read_u32/net_copy_u32() accordingly. Signed-off-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com> Signed-off-by: Sergey Temerkhanov <s.temerkhanov@gmail.com> Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/net.h')
-rw-r--r--include/net.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/net.h b/include/net.h
index 4488cc7d65..16fa117586 100644
--- a/include/net.h
+++ b/include/net.h
@@ -416,7 +416,7 @@ struct icmp_hdr {
ushort id;
ushort sequence;
} echo;
- ulong gateway;
+ u32 gateway;
struct {
ushort unused;
ushort mtu;
@@ -684,9 +684,9 @@ static inline struct in_addr net_read_ip(void *from)
}
/* return ulong *in network byteorder* */
-static inline ulong net_read_long(ulong *from)
+static inline u32 net_read_u32(u32 *from)
{
- ulong l;
+ u32 l;
memcpy((void *)&l, (void *)from, sizeof(l));
return l;
@@ -705,9 +705,9 @@ static inline void net_copy_ip(void *to, void *from)
}
/* copy ulong */
-static inline void net_copy_long(ulong *to, ulong *from)
+static inline void net_copy_u32(u32 *to, u32 *from)
{
- memcpy((void *)to, (void *)from, sizeof(ulong));
+ memcpy((void *)to, (void *)from, sizeof(u32));
}
/**
OpenPOWER on IntegriCloud