Skip to content

Commit

Permalink
Prevent VIP listing when listing NATs for 0.0.0.0, fixes #636
Browse files Browse the repository at this point in the history
  • Loading branch information
PlagueCZ committed Jan 16, 2025
1 parent 34fac0e commit d9ea4ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/dp_nat.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,10 @@ int dp_list_nat_local_entries(uint32_t nat_ip, struct dp_grpc_responder *respond
int32_t ret;
struct dpgrpc_nat *reply;

// VIP entries use the same table and have data->nat_ip set to 0 so they would match
if (nat_ip == 0)
return DP_GRPC_OK;

if (rte_hash_count(ipv4_snat_tbl) == 0)
return DP_GRPC_OK;

Expand Down
2 changes: 1 addition & 1 deletion src/grpc/dp_async_grpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ void DeleteNeighborNatCall::ParseReply(__rte_unused struct dpgrpc_reply* reply)

const char* ListNeighborNatsCall::FillRequest(struct dpgrpc_request* request)
{
DPGRPC_LOG_INFO("Getting NAT info",
DPGRPC_LOG_INFO("Listing neighbor Nats",
DP_LOG_IPV4STR(request_.nat_ip().address().c_str()));
if (!GrpcConv::GrpcToDpAddress(request_.nat_ip(), &request->list_localnat))
return "Invalid nat_ip";
Expand Down

0 comments on commit d9ea4ba

Please sign in to comment.