summaryrefslogtreecommitdiffstats
path: root/net/dhcp.c
Commit message (Collapse)AuthorAgeFilesLines
* net: dns: return error codesSascha Hauer2018-11-291-2/+4
| | | | | | | | | | | | | | The resolv() function used to return the IP address. When net_udp_new() fails we return an error code though which the callers of resolv() take as an IP address. This is wrong of course and we could return 0 in this case. Instead we return an error code and pass the resolved IP as a pointer which allows us to return proper error codes. This patch also adds error messages and error returns to the various callers of resolv() which used to just continue with a zero IP and let the user figure out what went wrong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2018-11-091-3/+3
|\
| * net: dhcp: fix option 54Marcin Niestroj2018-10-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Option 54 (Server Identifier) is something different than SIADDR (Server IP address). Currently they are used interchangeably. This causes DHCPNAK with DHCP servers that have configured different values for each field. Create new 'dhcp_serverip' field in 'struct dhcp_result', so we treat option 54 separately. This fixes DHCP requests for servers that send two different values for SIADDR and option 54 in DHCPOFFER. Fixes: 528298b702a0 ("net: dhcp: rework") Fixes: e18cc5b7e9ce ("DHCP: fix option 54 passing") Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: make routing work after dhcp commandAntony Pavlov2018-10-161-0/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment only ifup stuff turns netif up. After the commit f0624a701513 ('net: Do not route traffic to interfaces that are not up') the dhcp command keeps netif->ifup == false and network subsystem can't route packets. How to repropduce the problem on qemu-malta_defconfig: qemu-system-mips -nodefaults -M malta -m 256 \ -nographic -serial stdio -monitor null \ -bios barebox-flash-image \ -net user -net nic,model=rtl8139 ... barebox:/ dhcp eth0: 100Mbps full duplex link detected eth0: DHCP client bound to address 10.0.2.15 barebox:/ ping 10.0.2.2 ping failed: No route to host However if ifup command is used for network interface configuration then there is no network problem, e.g. barebox:/ ifup eth0 eth0: 100Mbps full duplex link detected eth0: DHCP client bound to address 10.0.2.15 barebox:/ ping 10.0.2.2 host 10.0.2.2 is alive Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> CC: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: add global variable for retriesOleg.Karfich@wago.com2018-09-041-1/+3
| | | | | Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: use private extension 224 also in discover requestsOleg.Karfich@wago.com2018-09-041-0/+7
| | | | | Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* DHCP: fix option 54 passingYegor Yefremov2018-02-221-5/+2
| | | | | | | | | | | | | | | Though variable net_dhcp_server_ip was declared and used as a function parameter it was never assigned. That's why a DHCP request was sent without option 54 set. Some DHCP server for example dnsmasq didn't accept such a packet. As both offered IP address and server IP are stored in the global dhcp_result structure we don't need either net_dhcp_server_ip or OfferedIP variables and can use the addresses from dhcp_result directly. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: make struct bootp __packed to prevent unaligned store on MIPSAntony Pavlov2018-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How to repropduce the unaligned store problem qemu-system-mips -nodefaults -M malta -m 256 \ -nographic -serial stdio -monitor null \ -bios barebox-flash-image \ -net user -net nic,model=rtl8139 ... barebox:/ dhcp Ooops, address error on store! $ 0 : 00000000 00000000 01010600 697f2a2e $ 4 : a0850000 00000000 0000001c a040c1b8 $ 8 : 00000000 00000002 00000002 00000000 $12 : 00000000 00000040 00000100 00000001 $16 : a040bba0 a0850000 a0850000 a0850000 $20 : 00000000 00000075 00000076 a040ba20 $24 : 00000002 a080f210 $28 : 00000000 a03ffce0 fffffffd a0833b8c Hi : 000154f8 Lo : 20000000 epc : a0833b84 ra : a0833b8c Status: 00000002 Cause : 80000414 Config: 80008482 ### ERROR ### Please RESET the board ### The unaligned store instruction is located in the bootp_request() from net/dhcp.c: a0833b50 <bootp_request>: .. a0833b7c: 3c020101 lui v0,0x101 a0833b80: 24420600 addiu v0,v0,1536 /* 0x1010600 -> v0 */ a0833b84: 0c20024a jal a0800928 <get_time_ns> a0833b88: ae02002a sw v0,42(s0) /* store 0x1010600 to addr s0 + 42 */ This assembler code is generated by mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 from this: bp = (struct bootp *)payload; bp->bp_op = OP_BOOTREQUEST; /* 0x01 */ bp->bp_htype = HWT_ETHER; /* 0x01 */ bp->bp_hlen = HWL_ETHER; /* 0x06 */ bp->bp_hops = 0; Compiler replaces four 'store byte' instruction by one 'store 32-bit word' instruction. Alas sometimes this leads to unaligned store situation. Making struct bootp __packed prevents this optimization and fixes the problem. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Tested-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: reworkSascha Hauer2017-12-141-322/+210
| | | | | | | | | | | | | | | The DHCP code is a mess. It is not clear which options are sent to the server and which options are returned from the server. Also environment variables are read from and written to all over the place. This patch cleans this up. There now is struct dhcp_req_param which is used for options sent to the server and struct dhcp_result which contains the values sent from the server. The values from the server are written to the barebox variables in a single place. Also it's now possible to call the dhcp code without modifying barebox variables at all, storing the result only in the dhcp result struct. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Coding style fixesSascha Hauer2017-12-141-7/+6
| | | | | | | Fix some spaces-before-function-opening-brackets and duplicate empty lines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: avoid unnecessary castsSascha Hauer2017-12-141-10/+8
| | | | | | Drop explicit casts to/from void pointers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Allow to specify network deviceSascha Hauer2017-12-141-6/+9
| | | | | | | | | Instead of allowing to DHCP only on the "current" network device, allow to specify the desired network device. This is a first step to get rid of the concept of a "current" network device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Do not overwrite serverip if it is validSascha Hauer2017-12-011-2/+2
| | | | | | | | | | | | | Some DHCP servers provide the wrong serverip in which case it is desired to specify it manually and won't let the dhcp command overwrite it. This has previously been done by setting the serverip again to the desired value after dhcp has been executed. With this patch we do not overwrite it in the first place if it is valid already. This is necessary when the serverip is not set via /env/network/eth* but via nv.net.server. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Make domainname and nameserver globalvarsSascha Hauer2017-12-011-2/+2
| | | | | | | | | Register domainname and nameserver as globalvars rather than attaching them to a dedicated net device. the global device already exists and already contains much of the barebox configuration, so no need to add an extra device for network config. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Add and use IP_BROADCASTSascha Hauer2017-12-011-1/+1
| | | | | | | Rather than using the hardcoded value 0xffffffff in several places add a define for the broadcast IP. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* convert users to %pI4Sascha Hauer2016-09-221-3/+3
| | | | | | | Convert users of ip_to_string() and print_IPaddr() to %pI4 and remove the now unused functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-3/+3
| | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: make unmodified variable constSascha Hauer2015-12-141-3/+3
| | | | | | | 'str' in dhcp_set_string_options is never modified, so make it const. With this we no longer have to cast away the const returned from getenv. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: simplify dhcp_options_processSascha Hauer2015-12-141-9/+6
| | | | | | | | | | dhcp_options_handle returns the index into the dhcp_options array. This is only to be able in the caller to print a debug message when the index returned from dhcp_options_handle is out of bounds. Simplify this by printing the debug message in dhcp_options_handle and not in the caller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: unify options and paramsSascha Hauer2015-12-141-77/+57
| | | | | | | | | The dhcp code distinguishes between options and params. If sent to the server they are params, if received from the server they are options. Unify them all to be options. If it has a handle_param callback it's a param, if it has a handle callback it's an option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Fix CONFIG variable nameWadim Egorov2015-09-291-1/+1
| | | | | Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Split dhcp funcionality & add dhcp commandWadim Egorov2015-06-051-101/+64
| | | | | | | | | | | | | dhcp/bootp was bound to the command functionality. This patch splits the dhcp command. We are now able to use bootp without a shell. This patch adds also a check for environment variables and globalvar. So only when ENVIRONMENT_VARIABLES and GLOBALVAR is set, all received dhcp data will be stored. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dhcp: fix request packet's seconds elapsedEric Bénard2015-01-291-2/+1
| | | | | | | it's done in the discover packet so let's do it also in the request packet. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dhcp: fix request packetEric Bénard2015-01-291-3/+1
| | | | | | | we are not supposed to fill ciaddr, yiaddr and siaddr in the request packet. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dhcp: fix request packet's requested IP optionEric Bénard2015-01-291-1/+1
| | | | | | | | | | | | In the request packet, we are supposed to copy the IP that the DHCP server provided in the offer packet so that dhcp_extended can fill the option 50. There is actually an error in barebox as the pointer to the packet currently built is used as the source instead of the pointer to the offer packet. With this patch, barebox now sends a request packet which includes the right requested IP in option 50. Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Do not use macros in command helpSascha Hauer2014-07-081-1/+1
| | | | | | | The help texts are parsed by sphinx which cannot handle macros, so replace them with their values. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-22/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dhcp: replace dhcp_getenv_int with getenv_uintSascha Hauer2013-10-071-11/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Make hostname available to C CodeSascha Hauer2013-08-161-1/+0
| | | | | | | The boards often have a sane default for the hostname. Provide a C function for setting/getting it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* globalvar: Allow to set initial valueSascha Hauer2013-08-161-1/+1
| | | | | | | Calling globalvar_add_simple() and setting a value is more than common. Add a parameter for the initial value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Fix tftp servername handlingSascha Hauer2013-05-141-3/+6
| | | | | | | | | | | | | When the dhcp code discovered the tftp-server-name option it immediately tries to resolve the name. This can't succeed since the we are somewhere in the dhcp processing and the nameserver may not even be known. Fix this by resolving the name when dhcp is completed. While at it, do this in a way that net_set_serverip is only called when resolv() returns something useful. Otherwise we may end up overwriting a previously configured serverip which came from the bootp bp_siaddr field. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: Fix return value on ctrl-cSascha Hauer2013-05-141-2/+4
| | | | | | | the dhcp command will return with 0 when ctrl-c is pressed. Fix this to -EINTR instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: fix typoSascha Hauer2013-02-281-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dhcp: add retries limit supportJean-Christophe PLAGNIOL-VILLARD2012-10-021-3/+34
| | | | | | | | | | | via -r opt, global.dhcp.retries or dhcp_retries set the priority order; This will allow to do not stay infinite loop if no dhcp available for boot sequence as example Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* dhcp: add copy_only_if_valid supportJean-Christophe PLAGNIOL-VILLARD2012-10-021-1/+6
| | | | | | | This will allow to only update a var if recive a valid data. This is need for hostname. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* dhcp: switch to global var supportJean-Christophe PLAGNIOL-VILLARD2012-10-021-19/+100
| | | | | | | | | | This way you can specify as previously set the dhcp parameter via global.dhcp.xxx and get the result via global.dhcp.xxx This is need for the defaultenv-2 to add the bootp suppport. Use it on defaultenv too to have only one set of var. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* defaultenv: switch hostname to global.hostnameJean-Christophe PLAGNIOL-VILLARD2012-10-021-2/+2
| | | | | | Udpate dhcp with it too. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into nextSascha Hauer2012-05-011-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | improve complete support The following patch serie improve the complete support by adding a complete framework to allow commands complete support. The add also car complete support for eval and setting and executable file support This also include an update of the stringlist API to support asprintf API
| * complete: add empty complete supportJean-Christophe PLAGNIOL-VILLARD2012-04-301-0/+2
| | | | | | | | | | | | | | | | | | | | for cpuinfo, clear, dhcp, false, login, lsmod, meminfo, passwd, pwd, reginfo, reset, true, usb, version for mach-imx and mach-mxs: dump_clocks for u_serial: mycdev Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | dhcp: set start timeSascha Hauer2012-04-301-0/+1
|/ | | | | | | | | The dhcp command starts with an unitialized start time. The start time is often long in the past which results in an immediate timeout and resend of the dhcp packet. Fix this by initializing the start time correctly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dhcp: fix typo introduce during rebase of hostname patchJean-Christophe PLAGNIOL-VILLARD2012-04-181-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: add support to send the hostname to the dhcp serverJean-Christophe PLAGNIOL-VILLARD2012-04-181-2/+12
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dhcp: set global nameserver/domainnameSascha Hauer2012-04-151-4/+2
| | | | | | | The nameserver and domainname are now globally available using the 'net' device. Use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: add private extention 224 to pass the oftree file via dhcp.Jean-Christophe PLAGNIOL-VILLARD2012-04-101-0/+5
| | | | | | | | | | | | | | | | | | | | | DHCP option 224 to 254 are for private use, so use one. Export it via env dhcp_oftree_file. E.g. the ISC dhcp server can be configured with | option oftree-path code 224 = string | class "at91sam9x5ek" { | match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek"; | | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage"; | option tftp-server-name "192.168.200.98"; | option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target"; | option oftree-path "/tftpboot/atmel/at91sam9x5/sam9x5ek/sam9g25ek/dtb"; | } Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dhcp: allow to set transmitted user classJean-Christophe PLAGNIOL-VILLARD2012-04-031-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For net boot setups it is useful to submit boot params like server or bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware, a custom vendor id can be sent in dhcp discover/request messages. E.g. the ISC dhcp server can be configured with | option client-uuid code 97 = { unsigned integer 8, string }; | class "at91sam9x5ek" { | match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek"; | | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage"; | if substring (option dhcp-client-identifier,0,7) = "ser2net" { | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net"; | } | if substring (option client-uuid,0,7) = "test" { | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net"; | } | if substring (option user-class,0,4) = "toto" { | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-toto"; | } | option tftp-server-name "192.168.200.98"; | option option-150 192.168.200.98; | next-server 192.168.200.98; | option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target"; | } Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: dhcp: allow to set transmitted client uuidJean-Christophe PLAGNIOL-VILLARD2012-04-031-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | For net boot setups it is useful to submit boot params like server or bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware, a custom client uuid can be sent in dhcp discover/request messages. E.g. the ISC dhcp server can be configured with | option client-uuid code 97 = { unsigned integer 8, string }; | class "at91sam9x5ek" { | match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek"; | | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage"; | if substring (option dhcp-client-identifier,0,7) = "ser2net" { | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net"; | } | if substring (option client-uuid,0,7) = "test" { | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net"; | } | option tftp-server-name "192.168.200.98"; | option option-150 192.168.200.98; | next-server 192.168.200.98; | option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target"; | } Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: dhcp: allow to set transmitted client idJean-Christophe PLAGNIOL-VILLARD2012-04-031-1/+9
| | | | | | | | | | | | | | | | | | | | | | | For net boot setups it is useful to submit boot params like server or bootfile over dhcp. To distinguish diffrent type of OS running on the same hardware, a custom client id can be sent in dhcp discover/request messages. E.g. the ISC dhcp server can be configured with | class "at91sam9x5ek" { | match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x5ek"; | | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage"; | if substring (option dhcp-client-identifier,0,7) = "ser2net" { | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage-ser2net"; | } | option tftp-server-name "192.168.200.98"; | option option-150 192.168.200.98; | next-server 192.168.200.98; | option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target"; | } Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: dhcp: factorise setting option codeJean-Christophe PLAGNIOL-VILLARD2012-04-031-34/+87
| | | | | | This will allow to add more easly new option with less impact in the binary. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* net: dhcp: add support of tftp name serverJean-Christophe PLAGNIOL-VILLARD2012-04-031-3/+17
| | | | | | | | | | | | | | | | | | | if the DNS is enable resolve it. The server ip will be set if no server ip it is set in the bootp. Export it via env dhcp_tftp_server_name. E.g. the ISC dhcp server can be configured with | class "at91sam9x5ek" { | match if substring (option vendor-class-identifier,0,20) = "barebox-at91sam9x | | filename "/tftpboot/atmel/at91sam9x5/sam9x5ek/zImage"; | option tftp-server-name "192.168.200.98"; | option root-path "192.168.200.98:/opt/work/buildroot/build/sam9x5/target"; | } | } Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>