Github user SolidWallOfCode commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/769#discussion_r82413194
  
    --- Diff: proxy/http/HttpSM.cc ---
    @@ -4726,6 +4727,44 @@ HttpSM::do_http_server_open(bool raw)
         milestones[TS_MILESTONE_SERVER_FIRST_CONNECT] = 
milestones[TS_MILESTONE_SERVER_CONNECT];
       }
     
    +  // Check for remap rule. If so, only apply ip_allow filter if it is 
activated (ip_allow_flag set).
    +  // Otherwise, if no remap rule is defined, apply the ip_allow filter. 
    +  if(!t_state.url_remap_success || (t_state.url_remap_success && 
t_state.url_map.getMapping()->ip_allow_flag)) {
    +
    +    // Method allowed on dest IP address check
    +    sockaddr *server_ip = &t_state.current.server->dst_addr.sa;
    +    IpAllow::scoped_config ip_allow;
    +    const AclRecord *acl_record = NULL;
    +    int method = t_state.hdr_info.server_request.method_get_wksidx();
    +
    +    if(ip_allow) {
    +      acl_record = ip_allow->match(server_ip, true);
    +      bool deny_request = false;
    +
    +      if (acl_record && !acl_record->isEmpty() && 
(acl_record->_method_mask != AclRecord::ALL_METHOD_MASK)) {
    +        if (method != -1) {
    +          deny_request = !acl_record->isMethodAllowed(method);
    +        } else {
    +          int method_str_len;
    +          const char *method_str = 
t_state.hdr_info.server_request.method_get(&method_str_len);
    +          deny_request = 
!acl_record->isNonstandardMethodAllowed(std::string(method_str, 
method_str_len));
    +        }
    +      }
    +      if (deny_request) {
    +        if (is_debug_tag_set("ip-allow")) {
    +          ip_text_buffer ipb;
    +          Warning("server '%s' prohibited by ip-allow policy", 
ats_ip_ntop(server_ip, ipb, sizeof(ipb)));
    +          Debug("ip-allow", "Quick filter denial on %s:%s with mask %x", 
ats_ip_ntop(&t_state.current.server->dst_addr.sa, ipb, sizeof(ipb)),
    --- End diff --
    
    "Quick filter"?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to