Lars Kellogg-Stedman
2010-Jul-23 01:30 UTC
[syslinux] PATCH: Let "dhcp" command iterate over interfaces like autoboot()
Hello all, I was reading http://www.etherboot.org/wiki/appnotes/autobootchainurl, and figured that as long as I was going to be modifying the code I might as well try a cleaner solution. ?Attached to this message is a patch that makes the following changes: 1) Allow the "dhcp" command to accept a list of interfaces and to try them in order until it succeeds, e.g.: ?gPXE> dhcp net0 net1 net2 ?In order to preserve the original syntax of the command, this will fail on an unknown interface name: gPXE> dhcp foo net0 No such interface: foo gPXE> The "-c" flag allows it to continue: gPXE> dhcp -c foo net0 No such interface: foo DHCP (net0 xx:xx:xx:xx:xx:xx).... ok gPXE> 2) If given the single parameter "any" as an interface name, iterate over all known interfaces in a manner similar to autoboot(): gPXE> dhcp any DHCP (net0 xx:xx:xx:xx:xx:xx)........ Connection timed out (...) Could not configure net0: Connection timed out (...) DHCP (net1 xx:xx:xx:xx:xx:xx).... ok gPXE> I think this manages to preserve the syntax of the existing "dhcp" command while making the magic of autoboot available to gpxe scripts. Please let me know if you have any comments. This code has only had limited testing, and I'm not terribly familiar with the gPXE code base. Please excuse any stylistic problems; I'd be happy to fix anything that needs fixing. Cheers, -- Lars -------------- next part -------------- A non-text attachment was scrubbed... Name: dhcp_multiple_interface.patch Type: application/octet-stream Size: 3687 bytes Desc: not available URL: <http://www.zytor.com/pipermail/syslinux/attachments/20100722/b61aa22d/attachment.obj>
Michael Brown
2010-Jul-23 01:44 UTC
[syslinux] PATCH: Let "dhcp" command iterate over interfaces like autoboot()
On Friday 23 Jul 2010 02:30:49 Lars Kellogg-Stedman wrote:> 2) If given the single parameter "any" as an interface name, iterate > over all known interfaces in a manner similar to autoboot():Personally I'd prefer a "-a"/"--all" option rather than a magic interface name "any".> I think this manages to preserve the syntax of the existing "dhcp" > command while making the magic of autoboot available to gpxe scripts. > Please let me know if you have any comments. This code has only had > limited testing, and I'm not terribly familiar with the gPXE code > base. Please excuse any stylistic problems; I'd be happy to fix > anything that needs fixing.I'm happy to clean it up and apply it to iPXE. Does anyone have any objections to using "-a" instead of "any"? Michael