[U-Boot] [RFC PATCH 6/8] net: TFTP over IPv6

Chris Packham judge.packham at gmail.com
Wed Nov 4 09:42:55 CET 2015


On Wed, Nov 4, 2015 at 8:43 AM, Joe Hershberger
<joe.hershberger at gmail.com> wrote:
> Hi Chris,
>
> On Tue, Nov 3, 2015 at 4:15 AM, Chris Packham <judge.packham at gmail.com> wrote:
>> On Tue, Nov 3, 2015 at 9:43 AM, Joe Hershberger
>> <joe.hershberger at gmail.com> wrote:
>>> Hi Chris,
>>>
>>> On Mon, Oct 12, 2015 at 2:43 AM, Chris Packham <judge.packham at gmail.com> wrote:
>>>> Add support for UDP/TFTP over IPv6.
>>>>
>>>> Signed-off-by: Chris Packham <judge.packham at gmail.com>
>>>> ---
>>>> One problem with the [hostIpAddr:]fileName syntax is that IPv6 addresses
>>>> contains colons. So tftp_start() would be confused by 'tftpboot6
>>>> $loadaddr 2001:db8::1:zImage'. It is probably possible to change the
>>>> parsing to separate the host from the filename by parsing from the end
>>>> (i.e. use strrchr() instead of strchr()) but then there are error cases
>>>> that may not be handled correctly (e.g. omitting the filename).
>>>
>>> I think we should just change the filename separator for tftp6. How about ','?
>>>
>>
>> The other strategy that is often used is to use square brackets to
>> separate the address from other data e.g. http://[2001:db8::1]:8080/.
>> Maybe that is a better (or at least more common) approach.
>
> Sounds good to me - I'm all for going with a common approach.
>

One wrinkle I've just discovered with this suggestion is the command
line help text. Consider the following

  => help tftpboot
  Usage:
  tftpboot [loadAddress] [[hostIPaddr:]bootfilename]

Now the IPv6 version if the above syntax is supported
  => help tftpboot6
  Usage:
  tftpboot6 [loadAddress] [[[hostIP6addr]:]bootfilename]

How do we convey that the address before the bootfilename is optional
but if it is specified square brackets are required around the
address. In other words

  tftpboot6 (valid)
  tftpboot6 zImage (valid)
  tftpboot6 2001:db8::1:zImage (invalid)
  tftpboot6 [2001:db8::1]:zImage (valid)

I still like the square bracket syntax and I'm still planning on
implementing it but I thought I'd raise this now to give people a
chance to object.


More information about the U-Boot mailing list