aboutgitcodebugslistschat
path: root/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'udp.c')
-rw-r--r--udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/udp.c b/udp.c
index e77345f..148b06a 100644
--- a/udp.c
+++ b/udp.c
@@ -933,7 +933,7 @@ int udp_tap_handler(struct ctx *c, int af, void *addr,
udp_tap_map[V4][src].ts = now->tv_sec;
- if (s_in.sin_addr.s_addr == c->gw4) {
+ if (s_in.sin_addr.s_addr == c->gw4 && !c->no_map_gw) {
if (!udp_tap_map[V4][dst].ts_local ||
udp_tap_map[V4][dst].loopback)
s_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
@@ -951,7 +951,7 @@ int udp_tap_handler(struct ctx *c, int af, void *addr,
sa = (struct sockaddr *)&s_in6;
sl = sizeof(s_in6);
- if (!memcmp(addr, &c->gw6, sizeof(c->gw6))) {
+ if (!memcmp(addr, &c->gw6, sizeof(c->gw6)) && !c->no_map_gw) {
if (!udp_tap_map[V6][dst].ts_local ||
udp_tap_map[V6][dst].loopback)
s_in6.sin6_addr = in6addr_loopback;