diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-23 07:59:07 +0000 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-23 17:46:18 -0500 |
commit | 4b11c9166b86ccc5f8f02fda01ded0f9e9760df0 (patch) | |
tree | cdf2b9de655df32a3937ea6a22395d67b21c469a /net/bootp.c | |
parent | 674bb249825aa9b0bddab046d23d43c33bb75f78 (diff) | |
download | u-boot-imx-4b11c9166b86ccc5f8f02fda01ded0f9e9760df0.zip u-boot-imx-4b11c9166b86ccc5f8f02fda01ded0f9e9760df0.tar.gz u-boot-imx-4b11c9166b86ccc5f8f02fda01ded0f9e9760df0.tar.bz2 |
net: Refactor IP, UPD, and ICMP header writing functions
ICMP (ping) was reimplementing IP header code... it now shares code.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'net/bootp.c')
-rw-r--r-- | net/bootp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bootp.c b/net/bootp.c index 009369b..7346993 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -619,9 +619,9 @@ BootpRequest(void) * determined. * C. Hallinan, DS4.COM, Inc. */ - /* NetSetIP(pkt, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, + /* net_set_udp_header(pkt, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, sizeof (struct Bootp_t)); */ - iphdr = pkt; /* We need this later for NetSetIP() */ + iphdr = pkt; /* We need this later for net_set_udp_header() */ pkt += IP_UDP_HDR_SIZE; bp = (struct Bootp_t *)pkt; @@ -663,7 +663,7 @@ BootpRequest(void) pktlen = ((int)(pkt-NetTxPacket)) + BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + ext_len; iplen = BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + ext_len; - NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen); + net_set_udp_header(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen); NetSetTimeout(SELECT_TIMEOUT, BootpTimeout); #if defined(CONFIG_CMD_DHCP) @@ -844,7 +844,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer) pktlen = ((int)(pkt-NetTxPacket)) + BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + extlen; iplen = BOOTP_HDR_SIZE - sizeof(bp->bp_vend) + extlen; - NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen); + net_set_udp_header(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen); debug("Transmitting DHCPREQUEST packet: len = %d\n", pktlen); #ifdef CONFIG_BOOTP_DHCP_REQUEST_DELAY |