[U-Boot] [PATCH v2 2/2] lib: net_utils: enforce '.' as octet separator in string_to_ip

Wolfgang Denk wd at denx.de
Wed Jan 4 11:09:47 CET 2017


Dear Chris Packham,

In message <20170104003626.4211-2-judge.packham at gmail.com> you wrote:
> Ensure '.' is used to separate octets. If another character is seen
> reject the string outright and return 0.0.0.0.

What is this good for?

The old code was forgiving and would accept 192,168,1,2 as well.
Do we need to be so strict here - at the cost of added code size?

Also, at least crtitical parts of the network code (NFS, TFTP) do not
check the return value of string_to_ip() - so what is the benefit of
this change?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
People are always a lot more complicated than you  think.  It's  very
important to remember that.             - Terry Pratchett, _Truckers_


More information about the U-Boot mailing list