cmcfarlen commented on code in PR #11951:
URL: https://github.com/apache/trafficserver/pull/11951#discussion_r1913749763
##########
src/proxy/http/remap/RemapConfig.cc:
##########
@@ -146,6 +143,15 @@ process_filter_opt(url_mapping *mp, const BUILD_TABLE_INFO
*bti, char *errStrBuf
bti->behavior_policy)) !=
nullptr) {
break;
}
+ if (auto rule = *rpp; rule) {
+ // If no IP addresses are listed, treat that like `@src_ip=all`.
+ if (rule->src_ip_valid == 0 && rule->src_ip_cnt == 0) {
+ src_ip_info_t *ipi = &rule->src_ip_array[rule->src_ip_cnt];
+ ipi->match_all_addresses = true;
+ rule->src_ip_cnt++;
+ rule->src_ip_valid = 1;
+ }
+ }
Review Comment:
Moved this logic to when the filter rules are merged during a map
declaration. This avoids the need to check if a src_ip was already added since
this happens outside of filter definition.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]