Bug #80067 [Asn->Csd]: Omitting the port in bindto setting results in "Failed to parse address" error

From: Date: Fri, 11 Sep 2020 13:03:08 +0000
Subject: Bug #80067 [Asn->Csd]: Omitting the port in bindto setting results in "Failed to parse address" error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228975@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80067&edit=1

 ID:                 80067
 Updated by:         cmb@php.net
 Reported by:        me at derrabus dot de
 Summary:            Omitting the port in bindto setting results in
                     "Failed to parse address" error
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Sockets related
 Operating System:   macOS 10.15
 PHP Version:        7.4.10
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=dfb3a799140d7d526c0ab77be437b663bfac9cc4
Log: Fix #80067: Omitting the port in bindto setting errors


Previous Comments:
------------------------------------------------------------------------
[2020-09-09 12:32:42] cmb@php.net

The following pull request has been associated:

Patch Name: Fix #80067: Omitting the port in bindto setting errors
On GitHub:  https://github.com/php/php-src/pull/6104
Patch:      https://github.com/php/php-src/pull/6104.patch

------------------------------------------------------------------------
[2020-09-07 11:48:29] me at derrabus dot de

> Except that has a different meaning.

Exactly, but the issue is the same. My fear was that we're focusing too much on that obscure
zero, so I wanted to demonstrate that the zero isn't really the issue here.

------------------------------------------------------------------------
[2020-09-07 08:58:22] requinix@php.net

> If that zero is too obscure, we can do the same with an actual IP address
> assigned to the machine you're running the code on,
Except that has a different meaning. I don't think there are too many good cases for binding to
all interfaces either, but PHP shouldn't disallow it just because it could be misused.

------------------------------------------------------------------------
[2020-09-07 08:40:40] me at derrabus dot de

> But I don’t think it is a good practice to use "0"

Probably. If that zero is too obscure, we can do the same with an actual IP address assigned to the
machine you're running the code on, like 192.168.0.1 for example.

* Setting bindto to "192.168.0.1:0" will work on 7.4.9 and 7.4.10.
* Setting bindto to "192.168.0.1" will work on 7.4.9 and break on 7.4.10.

So, omitting the port is what isn't possible anymore.

------------------------------------------------------------------------
[2020-09-07 03:18:13] twosee@php.net

It is indeed caused by https://github.com/php/php-src/pull/5903 ...
As a bugfix, the patch is correct, I think.
If we want to revert it to the previous behavior, we should change the implementation of
parse_ip_address_ex instead of reverting the patch.
But I don’t think it is a good practice to use "0"...

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=80067


--
Edit this bug report at https://bugs.php.net/bug.php?id=80067&edit=1


Thread (12 messages)

« previous php.bugs (#228975) next »