From 777c50fc4cb3fa09a9996cf5448147fd2dbab849 Mon Sep 17 00:00:00 2001 From: Christopher Canel Date: Tue, 7 May 2024 15:02:17 +0000 Subject: [PATCH] Change monitor port to refer to remote port --- ratemon/runtime/c/libratemon_interp.cpp | 3 ++- ratemon/runtime/c/ratemon.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ratemon/runtime/c/libratemon_interp.cpp b/ratemon/runtime/c/libratemon_interp.cpp index 2e8edb1..71188c7 100644 --- a/ratemon/runtime/c/libratemon_interp.cpp +++ b/ratemon/runtime/c/libratemon_interp.cpp @@ -398,7 +398,8 @@ int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) { RM_PRINTF("flow: %u:%u->%u:%u\n", flow.remote_addr, flow.remote_port, flow.local_addr, flow.local_port); - if (flow.local_port != monitor_port) { + if (!(flow.remote_port >= monitor_port && + flow.remote_port <= monitor_port + 1000)) { RM_PRINTF("INFO: ignoring flow on port %u, not on monitor port %u\n", flow.local_port, monitor_port); return new_fd; diff --git a/ratemon/runtime/c/ratemon.h b/ratemon/runtime/c/ratemon.h index 2ec1feb..ecd0f9e 100644 --- a/ratemon/runtime/c/ratemon.h +++ b/ratemon/runtime/c/ratemon.h @@ -35,8 +35,8 @@ // at most the oldest flow's epoch, even if other flows in the batch arrived // more recently). #define RM_NUM_TO_SCHEDULE_KEY "RM_NUM_TO_SCHEDULE" -// Environment variable that specifies the local port to manage using scheduled -// RWND tuning. +// Environment variable that specifies the start range of REMOTE ports to manage +// using scheduled RWND tuning. #define RM_MONITOR_PORT "RM_MONITOR_PORT" // Key for use in flow-based maps.