Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-12 Thread Noel Duffy via fpc-pascal
I've submitted a test program and proposed patch to fix the IPv6 parsing issues with StrToHostAddr6. https://bugs.freepascal.org/view.php?id=37013 Because I only checked out the packages and rtl directories from Subversion, my patch's root directory is packages. I hope this isn't a problem, b

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-07 Thread Noel Duffy via fpc-pascal
On 7/05/20 9:43 pm, Michael Van Canneyt wrote: On Thu, 7 May 2020, Noel Duffy via fpc-pascal wrote: Well, considering the amount of RFCs I implemented for FPC, I think I'll join you. Let me know what golf course you picked. If your email address is any indication, new zealand is a bit far off,

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-07 Thread Michael Van Canneyt
On Thu, 7 May 2020, Noel Duffy via fpc-pascal wrote: On 7/05/20 9:17 pm, Michael Van Canneyt wrote: On Thu, 7 May 2020, Noel Duffy via fpc-pascal wrote: Great. My worry was that the sockets unit might fall into the same category as the libc one, available but deprecated and not recommended

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-07 Thread Noel Duffy via fpc-pascal
On 7/05/20 9:17 pm, Michael Van Canneyt wrote: On Thu, 7 May 2020, Noel Duffy via fpc-pascal wrote: Great. My worry was that the sockets unit might fall into the same category as the libc one, available but deprecated and not recommended for use. Plus, when rewriting something that's been unc

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-07 Thread Noel Duffy via fpc-pascal
On 6/05/20 11:40 pm, Karoly Balogh (Charlie/SGR) wrote: 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 becaus

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-07 Thread Michael Van Canneyt
On Thu, 7 May 2020, Noel Duffy via fpc-pascal wrote: On 6/05/20 11:21 pm, Christo Crause via fpc-pascal wrote: > On Wed, May 6, 2020 at 12:19 PM Noel Duffy via fpc-pascal > > > wrote: > > So I guess the question is, is it worth the effort to make >

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-07 Thread Noel Duffy via fpc-pascal
On 6/05/20 11:21 pm, Christo Crause via fpc-pascal wrote: > On Wed, May 6, 2020 at 12:19 PM Noel Duffy via fpc-pascal > > > wrote: > > So I guess the question is, is it worth the effort to make > StrToHostAddr6 RFC4291 compliant? Is that something t

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-06 Thread Karoly Balogh (Charlie/SGR)
Hi, 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 th

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-06 Thread Christo Crause via fpc-pascal
On Wed, May 6, 2020 at 12:19 PM Noel Duffy via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > So I guess the question is, is it worth the effort to make > StrToHostAddr6 RFC4291 compliant? Is that something the FPC team would > want, or do they just not use the sockets unit? > There have

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-06 Thread Noel Duffy via fpc-pascal
On 3/05/20 10:28 pm, Michael Van Canneyt wrote: On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: On Sun, 3 May 2020 09:57:46 +0200 (CEST) Michael Van Canneyt wrote: Yes, please open a bug report. If you attach a small console test program that demonstrates the bug (and subsequently th

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Noel Duffy via fpc-pascal
On 3/05/20 10:28 pm, Michael Van Canneyt wrote: Yes, please open a bug report. If you attach a small console test program that demonstrates the bug (and subsequently the fix) then I will make sure it ends up in the correct place. If you make sure it exits with exit code 0 if all is well, an

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: On Sun, 3 May 2020 09:57:46 +0200 (CEST) Michael Van Canneyt wrote: On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: The problem is that the StrToHostAddr6 function doesn't set its return value until the end of the function. If a pa

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Noel Duffy via fpc-pascal
On Sun, 3 May 2020 09:57:46 +0200 (CEST) Michael Van Canneyt wrote: On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: The problem is that the StrToHostAddr6 function doesn't set its return value until the end of the function. If a parse error occurs mid-function, it zeroes the record in wh

Re: [fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Michael Van Canneyt
On Sun, 3 May 2020, Noel Duffy via fpc-pascal wrote: Using fpc 3.0.4 on Fedora 30. I've just started using the StrToHostAddr6 function in the sockets unit to parse IPv6 addresses. I've found a couple of issues with it. 1. Even if address parsing fails, StrToHostAddr6 doesn't return an all

[fpc-pascal] Bugs in StrToHostAddr6 in sockets unit

2020-05-03 Thread Noel Duffy via fpc-pascal
Using fpc 3.0.4 on Fedora 30. I've just started using the StrToHostAddr6 function in the sockets unit to parse IPv6 addresses. I've found a couple of issues with it. 1. Even if address parsing fails, StrToHostAddr6 doesn't return an all-zero result in the in6_addr return value. The documentat