-
Notifications
You must be signed in to change notification settings - Fork 596
util, ParseClientIP: support compressed ipv6 addresses #5547
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
Conversation
|
fyi @akalenyu |
akalenyu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @nixpanic
seems like this is a bug in 3.15
| { | ||
| name: "IPv6 address", | ||
| addr: "2001:0db8:85a3:0000:0000:8a2e:0370:7334:0/2686266785", | ||
| addr: "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:0/2686266785", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can the new impl. digest both? I wonder why the unit test was doing bracketless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New impl can't digest bracketless, but this should be the correct and mandatory notation as defined by RFC 3986 for ipv6 addresses with a specified port, as is the case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, should be okay, any backwards compatibility concern would be hopefully noted by maintainers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think 2001:0db8:85a3:0000:0000:8a2e:0370:7334:0 is a valid formatted IPv6 address, as the last :0 refers to a port (or wildcard in case of 0 with the Ceph session).
The format [2001:0db8:85a3:0000:0000:8a2e:0370:7334]:0 looks more correct to me.
|
Change - Fix lint issues. |
|
https://github.com/ceph/ceph-csi/actions/runs/17289568981/job/49168477608?pr=5547 |
1fdbff3 to
e66e6dd
Compare
|
Change - Address comments, take care to iterate on valid host pairs and omit version prefix before parse attempts. |
9b632ab to
75fc490
Compare
|
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
|
This pull request has been removed from the queue for the following reason: The pull request can't be updated. You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
|
@Mergifyio rebase |
Previously ParseClientIP would use regex to match addresses which was too strict and could only correctly match complete ipv4 and ipv6 addreses. This commit changes the ParseClientIP function to use Go's net package to correctly parse all valid ip forms. Signed-off-by: Adi Aloni <[email protected]>
✅ Branch has been successfully rebased |
75fc490 to
9c0e946
Compare
|
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
|
/test ci/centos/upgrade-tests-cephfs |
|
/test ci/centos/k8s-e2e-external-storage/1.33 |
|
/test ci/centos/upgrade-tests-rbd |
|
/test ci/centos/k8s-e2e-external-storage/1.31 |
|
/test ci/centos/mini-e2e-helm/k8s-1.33 |
|
/test ci/centos/mini-e2e-helm/k8s-1.31 |
|
/test ci/centos/mini-e2e/k8s-1.33 |
|
/test ci/centos/mini-e2e/k8s-1.31 |
|
/test ci/centos/k8s-e2e-external-storage/1.32 |
|
/test ci/centos/mini-e2e-helm/k8s-1.32 |
|
/test ci/centos/mini-e2e/k8s-1.32 |
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You may have to fix your CI before adding the pull request to the queue again. |
|
@Mergifyio requeue |
✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically |
Describe what this PR does
Previously ParseClientIP would use regex to match addresses which was too strict and could only correctly match complete ipv4 and ipv6 addresses.
This commit changes the ParseClientIP function to use Go's net package to correctly parse all valid ip forms.
Is there anything that requires special attention
Do you have any questions?
No
Is the change backward compatible?
Yes
Are there concerns around backward compatibility?
No
Provide any external context for the change, if any.
For example:
Related issues
Mention any github issues relevant to this PR. Adding below line
will help to auto close the issue once the PR is merged.
Fixes: #issue_number
Future concerns
List items that are not part of the PR and do not impact it's
functionality, but are work items that can be taken up subsequently.
Checklist:
guidelines in the developer
guide.
Request
notes
updated with breaking and/or notable changes for the next major release.
Show available bot commands
These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:
/retest ci/centos/<job-name>: retest the<job-name>after unrelatedfailure (please report the failure too!)