diff --git a/homa_rpc.c b/homa_rpc.c index 7804577e..91f013ce 100644 --- a/homa_rpc.c +++ b/homa_rpc.c @@ -844,6 +844,6 @@ void homa_rpc_get_info(struct homa_rpc *rpc, struct homa_rpc_info *info) rpc->msgin.bytes_remaining == 0 && skb_queue_len(&rpc->msgin.packets) == 0) info->flags |= HOMA_RPC_RX_READY; - if (rpc->flags & RPC_PRIVATE) + if (test_bit(RPC_PRIVATE, &rpc->flags)) info->flags |= HOMA_RPC_PRIVATE; } diff --git a/test/unit_homa_rpc.c b/test/unit_homa_rpc.c index 06d55123..534600c5 100644 --- a/test/unit_homa_rpc.c +++ b/test/unit_homa_rpc.c @@ -1572,7 +1572,18 @@ TEST_F(homa_rpc, homa_rpc_get_info__HOMA_RPC_PRIVATE) self->server_port, self->client_id, 5000, 20000); struct homa_rpc_info info; - crpc->flags |= RPC_PRIVATE; + set_bit(RPC_PRIVATE, &crpc->flags); homa_rpc_get_info(crpc, &info); EXPECT_EQ(HOMA_RPC_PRIVATE, info.flags); } +TEST_F(homa_rpc, homa_rpc_get_info__APP_NEEDS_LOCK_is_not_private) +{ + struct homa_rpc *crpc = unit_client_rpc(&self->hsk, + UNIT_OUTGOING, self->client_ip, self->server_ip, + self->server_port, self->client_id, 5000, 20000); + struct homa_rpc_info info; + + set_bit(APP_NEEDS_LOCK, &crpc->flags); + homa_rpc_get_info(crpc, &info); + EXPECT_EQ(0, info.flags); +}