path: root/net/bootp.c
AgeCommit message (Collapse)Author
2012-05-23net: Move debug trace to point of actionJoe Hershberger
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
2012-05-23net: Refactor bootp packet length computationsJoe Hershberger
Eliminate pointer subtraction that recovers values computed earlier Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
2012-05-23net: Refactor IP, UPD, and ICMP header writing functionsJoe Hershberger
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>
2012-05-23net: cosmetic: Rename OPT_SIZE to OPT_FIELD_SIZEJoe Hershberger
Clearer constant name. Also remove related BOOTP_SIZE which was unused and doesn't take into account VLAN packets. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-05-23net: cosmetic: Un-typedef Ethernet_tJoe Hershberger
Separate the Ethernet header from the 802 header. Base the size constants on the structs. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-05-23net: cosmetic: Un-typedef IP_tJoe Hershberger
Rename IP header related things to IP_UDP. The existing definition of IP_t includes UDP header, so name it to accurately describe the structure. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-05-23net: Move MAC-seeded rand out of bootp.cJoe Hershberger
Make the MAC-seeded random number generator available to /net in general. MAC-seeded rand will be needed by link-local as well, so give it an interface. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
2012-05-15net: cosmetic: bootp.* checkpatch complianceJoe Hershberger
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
2012-05-15net: Remove volatile from net APIJoe Hershberger
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Plumb in bootstage calls for basic operationsSimon Glass
This inserts bootstage calls into tftp, usb start and bootm. We could go further, but this is a reasonable start to illustrate the concept. Signed-off-by: Simon Glass <sjg@chromium.org>
2011-11-23net/bootp.c: Fix GCC 4.6 warningAnatolij Gustschin
Fix: bootp.c: In function 'BootpCopyNetParams': bootp.c:108:11: warning: unused variable 'tmp_ip' [-Wunused-variable] Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-10-27net: Export auto_load, use it in rarpSimon Glass
The rarp code includes another instance of the auto_load logic, so call what is now net_auto_load() instead. This also fixes an incorrect call to TftpStart() which was never seen since apparently no boards enable rarp. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-26net: tftpput: Support selecting get/put for tftpSimon Glass
TftpStart should support starting either a get or a put. Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-17net: bootp: add PXE/RFC 4578 DHCP options supportJason Hobbs
These options are required to be present in RFC 4578 compliant DHCP requests. They give more information to DHCP servers to allow serving different DHCP responses to different systems based on client architecture, client capabilities, UUID, or vendor. Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-09-19net/bootp.c: fix tftp load if autoload environment var isn't setPeter Korsgaard
Commit 093498669 (Put common autoload code into auto_load() function) broke handling of autoload environment variable not being set. The bootp/dhcp code will just keep on requesting IP address forever and never start TFTP download. Fix it by moving TftpStart() outside the conditional like it was before. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Tested-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
2011-08-08Put common autoload code into auto_load() functionSimon Glass
This is a small clean-up patch. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Eric BĂ©nard <eric@eukrea.com>
2011-07-27bootp: add ntpserver option to bootp requestLuuk Paulussen
Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz> Acked-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Cc: Ben Warren <biggerbadderben@gmail.com>
2011-05-12NET: pass source IP address to packet handlersLuca Ceresoli
This is needed for the upcoming TFTP server implementation. This also simplifies PingHandler() and fixes rxhand_f documentation. Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
2011-04-13Fix bad padding of bootp request packetSimon Glass
This seems to pad to one byte longer than required Signed-off-by: Simon Glass <sjg@chromium.org>
2010-11-14net: Fix potential empty DHCP Parameter Request ListJason Liu
Can't get IP address with dhcp due to the dhcp server not allow the empty param list request under some network env This patch is based on Gray Remlin's initial patch. Signed-off-by: Jason Liu <r64343@freescale.com> Signed-off-by: Gray Remlin <g_remlin@rocketmail.com>
2009-12-13net: pull CONFIG checks out of source and into makefileMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-09-11net/bootp.c: fix compile warningWolfgang Denk
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>
2009-08-07minor debug cleanups in ./netRobin Getz
Minor ./net cleanups - no functional changes - change #ifdef DEBUG printf(); #endif to just debug() - changed __FUNCTION__ to __func__ - got rid of extra whitespace between function and opening brace - removed unnecessary braces on if statements gcc dead code elimination should make this functionally/size equivalent when DEBUG is not defined. (confirmed on Blackfin, with gcc 4.3.3). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-07-22net: rename NetRxPkt to NetRxPacketMike Frysinger
The net code is mostly consistent in using 'Packet' rather than 'Pkt', so rename the minor detractor to follow suite. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-06-15A VLAN tagged DHCP request/discover is 4 bytes shortNorbert van Bolhuis
The problem is that BOOTP_SIZE uses ETHER_HDR_SIZE which is 14 bytes. If sending a VLAN tagged frame (when env variable vlan is set) this should be VLAN_ETHER_HDR_SIZE=18 which is what NetSetEther returns. Signed-off-by: Norbert van Bolhuis <nvbolhuis@aimvalley.nl> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-03-20net: get mac address from environment and use eth util funcsMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
2009-03-20convert print_IPaddr() to %pI4Mike Frysinger
Now that our printf functions support the %pI4 modifier like the kernel, let's drop the inflexible print_IPaddr() function and covert over to the %pI4 modifier. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18net: express the first argument to NetSetTimeout() in millisecondsBartlomiej Sieka
Enforce millisecond semantics of the first argument to NetSetTimeout() -- the change is transparent for well-behaving boards (CFG_HZ == 1000 and get_timer() countiing in milliseconds). Rationale for this patch is to enable millisecond granularity for network-related timeouts, which is needed for the upcoming automatic software update feature. Summary of changes: - do not scale the first argument to NetSetTimeout() by CFG_HZ - change timeout values used in the networking code to milliseconds Signed-off-by: Rafal Czubak <rcz@semihalf.com> Signed-off-by: Bartlomiej Sieka <tur@semihalf.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2008-08-26Fix bogus error message in the DHCP handlerRemy Bohmer
The DHCP handler has 1 state that is not listed in this case, causing a failure message when there is actually no failure. Signed-off-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2008-07-15Fix DHCP protocol so U-Boot does not respond too earlyRobin Getz
on the network with it's offered IP number; it should not reply until after it has received a DHCP ACK message. Also ensures that U-Boot does it's DHCPREQUEST as broadcast (per RFC 2131). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Acked-by: Ben Warren <biggerbadderben@gmail.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-14Fix printf() format issues with sizeof_t types by using %zuWolfgang Denk
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-13Coding Style cleanup; update CHANGELOGWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-03-30DHCP request fix for Windows Server 2003Aras Vaichas
Added option CONFIG_BOOTP_DHCP_REQUEST_DELAY. This provides an optional delay before sending "DHCP Request" in net/bootp.c. Required to overcome interoperability problems with Windows Server 200x DHCP server when U-Boot client responds too fast for server to handle. Signed-off-by: Aras Vaichas <arasv@magtech.com.au> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2007-11-18Fix warning differ in signedness in net/net.c and net/nfs.cJean-Christophe PLAGNIOL-VILLARD
2007-11-03Cleanup coding style; update CHANGELOGWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2007-11-01DHCP Client FixJustin Flammia
This is a multi-part message in MIME format. commit e6e505eae94ed721e123e177489291fc4544b7b8 Author: Justin Flammia <jflammia@savantav.com> Date: Mon Oct 29 17:19:03 2007 -0400 Found a bug in the way the DHCP Request packet is built, where the IP address that is offered by the server is bound to prematurely. This patch is a fix of that bug where the IP address offered by the DHCP server is not used until after the DHCP ACK from the server is received. Signed-off-by: Justin Flammia <jflammia@savantav.com> Signed-off-by: Ben Warren <bwarren@qstreams.com>
2007-09-18Avoid compiler warning.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2007-08-13New CONFIG_BOOTP_SERVERIP optionWilson Callan
Added CONFIG_BOOTP_SERVERIP to allow the tftp server to be different from the bootp server Signed-off-by: Wilson Callan <wcallan@savantav.com> Signed-off-by: Ben Warren <bwarren@qstreams.com>
2007-07-10net/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger
Fixed some broken instances of "#ifdef CMD_CFG_IDE" too. Those always evaluated TRUE, and thus were always compiled even when IDE really wasn't defined/wanted. Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-07-09Finally retire cmd_confdefs.h and CONFIG_BOOTP_MASK!Jon Loeliger
All of the choices for CONFIG_BOOTP_ are now documented in the README file. You must now individually select exactly the set that you want using a series of #define CONFIG_BOOTP_<x> statements in the board port config files now. Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-07-09net/: Remove obsolete references to CONFIG_COMMANDSJon Loeliger
Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-07-04net/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger
This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
2006-10-12Minor code cleanup.Wolfgang Denk
2006-10-09Make bootp implementation RFC3046 compliantWolfgang Denk
Patch by Joakim Larsson, 27 Jun 2006
2006-03-12Add support for the DHCP vendor optional bootfile (#67).Wolfgang Denk
Ignores the vendor TFTP server name option (#66). Patch by Murray Jensen, 30 Jun 2005
2005-10-13Cleanup for GCC-4.xWolfgang Denk
2005-04-02Fix problems with SNTP support;wdenk
enable SNTP support in some boards.
2005-04-01* Patch by Masami Komiya, 30 Mar 2005:wdenk
add SNTP support and expand time server and time offset fields of DHCP support. See doc/README.SNTP * Patch by Steven Scholz, 13 Dec 2004: Fix bug in at91rm920 ethernet driver
2004-04-15Patches by Pantelis Antoniou, 30 Mar 2004:wdenk
add networking support for VLANs (802.1q), and CDP (Cisco Discovery Protocol)