Skip to content

IPv6 support for php-fpm (fixes: #55508) #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Conversation

globin
Copy link
Contributor

@globin globin commented Mar 24, 2014

This removes hardcoded IPv4 code and adds support for IPv6

@@ -55,7 +55,7 @@
; Default Value: 0
;emergency_restart_threshold = 0

; Interval of time used by emergency_restart_interval to determine when
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but could you fix these silly space issues? :)

@globin
Copy link
Contributor Author

globin commented Apr 3, 2014

fixed and rebased

@globin globin changed the title IPv6 support for php-fpm IPv6 support for php-fpm (fixes: #55508) Apr 21, 2014
@acasademont
Copy link
Contributor

+1 please, php-fpm is the last component in our internal network that does not support ipv6, we would love to kill ipv4 internally :)

@SjonHortensius
Copy link
Contributor

Yes I agree; we have the exact same problem. Everything runs over ipv6 but our firewalls need to make 1 exception because fpm cannot handle ipv6. The only alternative is running an instance of socat to convert ipv6 to ipv4....

@jucrouzet
Copy link

+1000 this would kill the last IPv4 dep

@arjenschol
Copy link

+1!
IPv6 support would be really really nice!

@SanderVanLeeuwen
Copy link

Yes please!

@acasademont
Copy link
Contributor

Is somebody going to take a look at this before PHP 5.6?

@Majkl578
Copy link
Contributor

Majkl578 commented Jul 3, 2014

💯

What happens when one enters only port? Will it listen on both IPv4 and IPv6?

@Majkl578
Copy link
Contributor

Majkl578 commented Jul 6, 2014

Ping @Tyrael, what do you think? Possible for 5.6?

@Tyrael
Copy link
Contributor

Tyrael commented Jul 6, 2014

We are too deep into the release release (we already had an RC2, feature freeze since beta1) to have this in 5.6, but we I would like to see this in master. Sorry that we missed this, I will try to do a better job with keeping up with the pull requests, but if you see an rfc not getting the deserved attention, feel free to drop a reminder email to [email protected]

@nikic
Copy link
Member

nikic commented Jul 6, 2014

@Tyrael This looks like a minor, self-contained feature addition. Can't we add that in 5.6.1? Unless I misunderstand the impact, this could also go to 5.5.

@Tyrael
Copy link
Contributor

Tyrael commented Jul 6, 2014

@nikic it is a possibility for 5.6.1. for 5.5 we should ask @jpauli

@Majkl578
Copy link
Contributor

Majkl578 commented Aug 6, 2014

Bump.

@arjenschol
Copy link

We are too deep into the release release (we already had an RC2, feature freeze since beta1) to have this in 5.6, but we I would like to see this in master.

Surprisingly, this can be added in RC4: "Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option" a51bf0c

No references to a pull request, bug report or whatsoever. An individual PHP develeoper with git access can do whatever they want. A pull request for IPv6 support which should have been added 5 years ago, with multiple votes and issues on bugs.php.net cannot be merged "because of feature freeze".

Strange...

@acasademont
Copy link
Contributor

indeed this is pretty absurd...

@jpauli
Copy link
Member

jpauli commented Aug 6, 2014

I'm all right to have this added to 5.5

if (addr != NULL) {
addr_len = strlen(addr);
if (addr[0] == '[' && addr[addr_len - 1] == ']') {
addr[addr_len - 1] = '\0';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like replacing ']' by \0 which seems strange to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpauli if the user enters an ipv6 address with the [ip]:port format those [ and ] have to be removed. This line you pointed just deletes the ] in the last char and the next line addr++; deletes the [ in the first char

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup I see now

@Tyrael
Copy link
Contributor

Tyrael commented Aug 6, 2014

@arjenschol Thanks for catching this, I've just sent an email to the author to revert
it, since we are in feature freeze since beta1.

@fadenb
Copy link

fadenb commented Aug 6, 2014

+1 lets get rid of legacy IP.

@arjenschol
Copy link

Now 5.6.0 is released, can this be pulled into the 5.6 branch for release in 5.6.1?

@kaplanlior
Copy link
Contributor

From the thread above it seems you should have it into 5.5 and merge it
into 5.6...

On Fri, Aug 29, 2014 at 12:01 PM, Arjen [email protected] wrote:

Now 5.6.0 is released, can this be pulled into the 5.6 branch for release
in 5.6.1?


Reply to this email directly or view it on GitHub
#631 (comment).

@acasademont
Copy link
Contributor

let me ping @Tyrael and @jpauli about this, hope we can finally make it!

@Tyrael
Copy link
Contributor

Tyrael commented Sep 1, 2014

I would be fine having this in 5.6.1, as it shouldn't have any impact for existing fpm deployments, but people can opt-in to listen on the v6 address with the new config option.
@jpauli what do you think about having it in 5.5?

@jpauli
Copy link
Member

jpauli commented Sep 1, 2014

Yes sure, it can go to 5.5 as well

@arjenschol
Copy link

Meanwhile, some more features are being added to 5.6.1.. But not this patch.

With 5.6.1 now RC1, guess we have to wait at least another month..

@acasademont
Copy link
Contributor

this must be a joke or something...

@Tyrael
Copy link
Contributor

Tyrael commented Sep 12, 2014

@jpauli so what are we waiting for merging this?

@Majkl578
Copy link
Contributor

This is sad. So much ignorance... 😟

@Majkl578
Copy link
Contributor

Also, noone yet answered my question:

What happens when one enters only port? Will it listen on both IPv4 and IPv6?

@acasademont
Copy link
Contributor

@Majkl578 i can't guarantee that without testing it but looking at the code it should open connections for both ipv4 and ipv6 if you only set the port :)

@Majkl578
Copy link
Contributor

Bump again, ping @Tyrael + @jpauli. This is really getting awkward...

@acasademont: Thanks, that's how it should work, I was just curious whether the implementation is aware of that. :)

@Majkl578
Copy link
Contributor

Majkl578 commented Oct 3, 2014

Bump.

@acasademont
Copy link
Contributor

Seems like it's time for PHP 5.6.2 merges :p

@Tyrael @jpauli please do not forget this one, thanks!

@Tyrael
Copy link
Contributor

Tyrael commented Oct 3, 2014

hi, I've merged the patch into 5.5 and upwards.
squashed the three commits into a single one, but kept you as the author.
thanks for the contribution, and sorry that it took this long to get it merged.

@Tyrael Tyrael closed this Oct 3, 2014
@SjonHortensius
Copy link
Contributor

Wow, great.Thanks!

@acasademont
Copy link
Contributor

thank you all! this is awesome news :D

@acasademont
Copy link
Contributor

@jpauli @Tyrael in PHP 5.5.18 this PR was finally pulled off and added for 5.5.19 but the NEWS file states that this appeared on 5.5.18 which may lead to confusion. Could that line be added to the 5.5.19 changelog? Thanks!!

@laruence
Copy link
Member

Hey @globin , I consistently see sapi/fpm/tests/003.phpt fails with:

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Address family for hostname not supported in /home/huixinchen/opensource/trunk/sapi/fpm/tests/003.php on line 24

@leofeyer
Copy link
Contributor

This change (or another FPM related change in version 5.5.19 and 5.6.3) seems to break PHP-FPM when using the network stack. It can be reproduced e.g. on Ubuntu 14.04 by creating 5 different pools (port numbers 9001 to 9005) and then starting the PHP-FPM service. I would expect to have a listener on each of the five ports, instead only the first pool is actually loaded. The others fail to load (can e.g. be checked with netstat -tlpn | sort).

I had to downgrade to version 5.5.18/5.6.2 to fix the issue.

@SjonHortensius
Copy link
Contributor

@leofeyer I have reported a similar bug for that @ https://bugs.php.net/bug.php?id=68420. I don't think posting bugs in the comments of PR is a good idea

@leofeyer
Copy link
Contributor

@SjonHortensius Thanks, but this bug seems to handle a different issue, so I have created a separate one: https://bugs.php.net/bug.php?id=68423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.