Browse Source

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 <wong.syrone@gmail.com>
pull/587/head
Syrone Wong 9 years ago
committed by Max Lv
parent
commit
06d92c923c
1 changed files with 1 additions and 1 deletions
  1. 2
      src/udprelay.c

2
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;
}
}

Loading…
Cancel
Save