You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "shreemaan-abhishek (via GitHub)" <gi...@apache.org> on 2023/04/27 13:48:36 UTC

[GitHub] [apisix] shreemaan-abhishek opened a new pull request, #9386: chore: clarify the support for IPV6

shreemaan-abhishek opened a new pull request, #9386:
URL: https://github.com/apache/apisix/pull/9386

   ### Description
   
   
   
   Fixes #9378 
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] kayx23 commented on a diff in pull request #9386: chore: clarify the support for IPV6

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #9386:
URL: https://github.com/apache/apisix/pull/9386#discussion_r1179682170


##########
docs/en/latest/admin-api.md:
##########
@@ -1382,8 +1382,8 @@ Stream Route resource request address:  /apisix/admin/stream_routes/{id}
 | ----------- | -------- | -------- | ------------------------------------------------------------------- | ----------------------------- |
 | upstream    | False    | Upstream | Configuration of the [Upstream](./terminology/upstream.md). |                               |
 | upstream_id | False    | Upstream | Id of the [Upstream](terminology/upstream.md) service.      |                               |
-| remote_addr | False    | IP/CIDR  | Filters Upstream forwards by matching with client IP.               | "127.0.0.1/32" or "127.0.0.1" |
-| server_addr | False    | IP/CIDR  | Filters Upstream forwards by matching with APISIX Server IP.        | "127.0.0.1/32" or "127.0.0.1" |
+| remote_addr | False    | IP/CIDR  | Filters Upstream forwards by matching with client IP.               | "127.0.0.1/32" or "127.0.0.1" or "::ffff:7f00:1" |

Review Comment:
   ```suggestion
   | remote_addr | False    | IPv4, IPv4 CIDR, IPv6  | Filters Upstream forwards by matching with client IP.               | "127.0.0.1" or "127.0.0.1/32" or "::ffff:7f00:1" |
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] kayx23 commented on a diff in pull request #9386: chore: clarify the support for IPV6

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #9386:
URL: https://github.com/apache/apisix/pull/9386#discussion_r1179946741


##########
t/admin/stream-routes.t:
##########
@@ -607,3 +607,47 @@ GET /t
 {"error_msg":"unknown protocol [xxx]"}
 passed
 {"error_msg":"property \"faults\" validation failed: wrong type: expected array, got string"}
+
+
+
+=== TEST 17: set route with remote_addr and server_addr in IPV6
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/stream_routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "remote_addr": "::ffff:7f00:1",

Review Comment:
   If I recall correctly, `::ffff:7f00:1` is IPv4-mapped. `::1` is the most native and standard IPv6 loopback address 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] kayx23 commented on a diff in pull request #9386: chore: clarify the support for IPV6

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #9386:
URL: https://github.com/apache/apisix/pull/9386#discussion_r1179946741


##########
t/admin/stream-routes.t:
##########
@@ -607,3 +607,47 @@ GET /t
 {"error_msg":"unknown protocol [xxx]"}
 passed
 {"error_msg":"property \"faults\" validation failed: wrong type: expected array, got string"}
+
+
+
+=== TEST 17: set route with remote_addr and server_addr in IPV6
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/stream_routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "remote_addr": "::ffff:7f00:1",

Review Comment:
   look at my profile bio? location? lol.
   
   If I recall correctly, `::ffff:7f00:1` is IPv4-mapped. `::1` is the most native and standard IPv6 loopback address. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] monkeyDluffy6017 merged pull request #9386: test: clarify the support for IPV6

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 merged PR #9386:
URL: https://github.com/apache/apisix/pull/9386


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] kayx23 commented on a diff in pull request #9386: chore: clarify the support for IPV6

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #9386:
URL: https://github.com/apache/apisix/pull/9386#discussion_r1179684173


##########
t/admin/stream-routes.t:
##########
@@ -607,3 +607,47 @@ GET /t
 {"error_msg":"unknown protocol [xxx]"}
 passed
 {"error_msg":"property \"faults\" validation failed: wrong type: expected array, got string"}
+
+
+
+=== TEST 17: set route with remote_addr and server_addr in IPV6
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/stream_routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "remote_addr": "::ffff:7f00:1",

Review Comment:
   Q: why `::ffff:7f00:1` instead of `::1`, `fe80::1`, or `fe80::1/64` that are more common?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on pull request #9386: chore: clarify the support for IPV6

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on PR #9386:
URL: https://github.com/apache/apisix/pull/9386#issuecomment-1539446969

   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] shreemaan-abhishek commented on a diff in pull request #9386: chore: clarify the support for IPV6

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on code in PR #9386:
URL: https://github.com/apache/apisix/pull/9386#discussion_r1179923666


##########
t/admin/stream-routes.t:
##########
@@ -607,3 +607,47 @@ GET /t
 {"error_msg":"unknown protocol [xxx]"}
 passed
 {"error_msg":"property \"faults\" validation failed: wrong type: expected array, got string"}
+
+
+
+=== TEST 17: set route with remote_addr and server_addr in IPV6
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/stream_routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "remote_addr": "::ffff:7f00:1",

Review Comment:
   Oh, I did not know that a simpler notation existed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] kayx23 commented on pull request #9386: test: clarify the support for IPV6

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on PR #9386:
URL: https://github.com/apache/apisix/pull/9386#issuecomment-1545004523

   cc @leslie-tsang 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] kayx23 commented on a diff in pull request #9386: chore: clarify the support for IPV6

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #9386:
URL: https://github.com/apache/apisix/pull/9386#discussion_r1179682170


##########
docs/en/latest/admin-api.md:
##########
@@ -1382,8 +1382,8 @@ Stream Route resource request address:  /apisix/admin/stream_routes/{id}
 | ----------- | -------- | -------- | ------------------------------------------------------------------- | ----------------------------- |
 | upstream    | False    | Upstream | Configuration of the [Upstream](./terminology/upstream.md). |                               |
 | upstream_id | False    | Upstream | Id of the [Upstream](terminology/upstream.md) service.      |                               |
-| remote_addr | False    | IP/CIDR  | Filters Upstream forwards by matching with client IP.               | "127.0.0.1/32" or "127.0.0.1" |
-| server_addr | False    | IP/CIDR  | Filters Upstream forwards by matching with APISIX Server IP.        | "127.0.0.1/32" or "127.0.0.1" |
+| remote_addr | False    | IP/CIDR  | Filters Upstream forwards by matching with client IP.               | "127.0.0.1/32" or "127.0.0.1" or "::ffff:7f00:1" |

Review Comment:
   ```suggestion
   | remote_addr | False    | IPv4, IPv4 CIDR, IPv6  | Filters Upstream forwards by matching with client IP.               | "127.0.0.1" or "127.0.0.1/32" or "::ffff:7f00:1" |
   ```
   similar for the others 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org