Skip to content

[HttpFoundation] fix checkip6 #12572

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 1 commit into from
Closed

Conversation

Neime
Copy link
Contributor

@Neime Neime commented Nov 25, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

I have this error ContextErrorException: Warning: inet_pton(): Unrecognized address X.X.X.X:X
in IpUtils.php line 110

X.X.X.X:X is detected as a ipv6 because HTTP_X_FORWARDED_FOR have a port.

@xabbuh
Copy link
Member

xabbuh commented Nov 25, 2014

I'm not sure if this fix is the right way to deal with your issue. X.X.X.X:X is no valid IP address (neither IPv4 nor IPv6).

@nicolas-grekas nicolas-grekas changed the title [Debug] fix checkip6 [HttpFoundation] fix checkip6 Nov 25, 2014
@Neime
Copy link
Contributor Author

Neime commented Dec 10, 2014

Yes, i'm ok with you but i think that it's a more effective ipv6 check.
PS : i can't access the stacktrace anymore, to find the real issue's origin.

@fabpot
Copy link
Member

fabpot commented Dec 25, 2014

👍 The root cause is fixed in #13114

@sstok
Copy link
Contributor

sstok commented Dec 28, 2014

👍

@fabpot
Copy link
Member

fabpot commented Dec 29, 2014

Thank you @Neime.

fabpot added a commit that referenced this pull request Dec 29, 2014
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #12572).

Discussion
----------

[HttpFoundation] fix checkip6

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

I have this error ContextErrorException: Warning: inet_pton(): Unrecognized address X.X.X.X:X
in IpUtils.php line 110

X.X.X.X:X is detected as a ipv6 because HTTP_X_FORWARDED_FOR have a port.

Commits
-------

1da0ba4 [Debug] fix checkip6
@fabpot fabpot closed this Dec 29, 2014
fabpot added a commit that referenced this pull request Dec 29, 2014
…-For HTTP head... (fabpot)

This PR was merged into the 2.3 branch.

Discussion
----------

[HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP head...

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

On symfony.com, we have errors related to IP addresses in the `X-Forwarded-For` HTTP header that have a port. If that happens (I have no ideas what is doing that), the page crashes with an error like `inet_pton(): Unrecognized address 187.65.229.211:63479` (which comes from IpUtils::checkIpv6()). This fixes the root cause by removing the port.

#12572 is solving the consequence and I propose to also merge it.

Commits
-------

60ad382 [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy