From 06d92c923ccfa9ca2f3263dfa99e39f297416c03 Mon Sep 17 00:00:00 2001 From: Syrone Wong Date: Fri, 15 Apr 2016 23:34:35 +0800 Subject: [PATCH] compare port as well The whole remote_ctx is inserted into the cache and sockaddr_storage contains both address and port. Signed-off-by: Syrone Wong --- src/udprelay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/udprelay.c b/src/udprelay.c index 129e4643..078cb5f5 100644 --- a/src/udprelay.c +++ b/src/udprelay.c @@ -1024,7 +1024,7 @@ static void server_recv_cb(EV_P_ ev_io *w, int revents) cache_lookup(conn_cache, key, HASH_KEY_LEN, (void *)&remote_ctx); if (remote_ctx != NULL) { - if (sockaddr_cmp_addr(&src_addr, &remote_ctx->src_addr, sizeof(src_addr))) { + if (sockaddr_cmp(&src_addr, &remote_ctx->src_addr, sizeof(src_addr))) { remote_ctx = NULL; } }