summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-05-23 07:58:09 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-05-23 17:46:15 -0500
commite0a630795b35f3137a3204e0d8e5fea928f8962b (patch)
treef72792762c7481f2e0ef550de5dceaa40930ffa3
parent738853bb6d290dc4b52d8c2989c0998d7aa26913 (diff)
downloadu-boot-imx-e0a630795b35f3137a3204e0d8e5fea928f8962b.zip
u-boot-imx-e0a630795b35f3137a3204e0d8e5fea928f8962b.tar.gz
u-boot-imx-e0a630795b35f3137a3204e0d8e5fea928f8962b.tar.bz2
net: cosmetic: Un-typedef ICMP_t
Remove typedef and lower-case name Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r--include/net.h6
-rw-r--r--net/net.c2
-rw-r--r--net/ping.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/include/net.h b/include/net.h
index eeea466..fd19c42 100644
--- a/include/net.h
+++ b/include/net.h
@@ -298,7 +298,7 @@ struct arp_hdr {
/* Codes for NOT_REACH */
#define ICMP_NOT_REACH_PORT 3 /* Port unreachable */
-typedef struct icmphdr {
+struct icmp_hdr {
uchar type;
uchar code;
ushort checksum;
@@ -314,8 +314,10 @@ typedef struct icmphdr {
} frag;
uchar data[0];
} un;
-} ICMP_t;
+};
+#define ICMP_HDR_SIZE (sizeof(struct icmp_hdr))
+#define IP_ICMP_HDR_SIZE (IP_HDR_SIZE + ICMP_HDR_SIZE)
/*
* Maximum packet size; used to allocate packet storage.
diff --git a/net/net.c b/net/net.c
index 6d34254..4cdd9cd 100644
--- a/net/net.c
+++ b/net/net.c
@@ -825,7 +825,7 @@ static inline struct ip_udp_hdr *NetDefragment(struct ip_udp_hdr *ip, int *lenp)
static void receive_icmp(struct ip_udp_hdr *ip, int len,
IPaddr_t src_ip, struct ethernet_hdr *et)
{
- ICMP_t *icmph = (ICMP_t *)&ip->udp_src;
+ struct icmp_hdr *icmph = (struct icmp_hdr *)&ip->udp_src;
switch (icmph->type) {
case ICMP_REDIRECT:
diff --git a/net/ping.c b/net/ping.c
index 04a594c..3102521 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -100,7 +100,7 @@ void ping_start(void)
void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
{
- ICMP_t *icmph = (ICMP_t *)&(ip->udp_src);
+ struct icmp_hdr *icmph = (struct icmp_hdr *)&ip->udp_src;
IPaddr_t src_ip;
switch (icmph->type) {