[fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

Karoly Balogh (Charlie/SGR) charlie at scenergy.dfmk.hu
Wed May 6 13:40:02 CEST 2020


On Wed, 6 May 2020, Noel Duffy via fpc-pascal wrote:

> Testing would also have to be fairly rigorous to make sure all the
> different formats are handled correctly. I've already done some  work to
> make it easy to compare StrToHostAddr6's output to that of inet_pton in
> the C library, so this would at least provide a good method to quickly
> spot problems.
> So I guess the question is, is it worth the effort to make
> StrToHostAddr6 RFC4291 compliant? Is that something the FPC team would
> want,

Definitely yes. FPC is not a commercial "product", it's an open source
project, and contributions like this are the whole idea behind open
source, and makes projects like FPC actually viable. Note that the code
you're looking into is very old (almost 15 years old), and was a
contributed code in the first place, not written by the FPC team (see SVN
r939). And this also means it actually predates the RFC you refer to. :)
So it definitely needs an overhaul.

> or do they just not use the sockets unit?

As much as we use the compiler and associated libraries ourselves, we
can't cover every use case, or find every bug. A lot of packages are there
for completeness, or because someone submitted it, or for compatibility
with Delphi, not because we necessarily use it ourselves. So if you find
weak spots like this where you feel you can do better, do it and submit


More information about the fpc-pascal mailing list