You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bneradt (via GitHub)" <gi...@apache.org> on 2023/11/08 01:41:51 UTC

[PR] Fix sni.yaml's ip_allow [trafficserver]

bneradt opened a new pull request, #10749:
URL: https://github.com/apache/trafficserver/pull/10749

   The sni.yaml's version of ip_allow had an inverted conditional check. This adds a test for the feature and fixes the condition.


-- 
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: github-unsubscribe@trafficserver.apache.org

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


Re: [PR] Fix sni.yaml's ip_allow [trafficserver]

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


-- 
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: github-unsubscribe@trafficserver.apache.org

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


Re: [PR] Fix sni.yaml's ip_allow [trafficserver]

Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #10749:
URL: https://github.com/apache/trafficserver/pull/10749#discussion_r1386921323


##########
src/iocore/net/SNIActionPerformer.cc:
##########
@@ -373,12 +373,12 @@ SNI_IpAllow::load(swoc::TextView content, swoc::TextView server_name)
   while (!content.ltrim(delim).empty()) {
     swoc::TextView token{content.take_prefix_at(delim)};
     if (swoc::IPRange r; r.load(token)) {
-      Dbg(dbg_ctl_ssl_sni, "%.*s is not a valid format", static_cast<int>(token.size()), token.data());
-      break;
-    } else {
       Dbg(dbg_ctl_ssl_sni, "%.*s added to the ip_allow token %.*s", static_cast<int>(token.size()), token.data(),
           int(server_name.size()), server_name.data());
       ip_addrs.fill(r);
+    } else {
+      Dbg(dbg_ctl_ssl_sni, "%.*s is not a valid format", static_cast<int>(token.size()), token.data());
+      break;

Review Comment:
   This is the functional change. It inverts the conditional because r.load returns true if the token is a valid IP format.



-- 
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: github-unsubscribe@trafficserver.apache.org

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