diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-10-14 05:26:37 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-10-14 13:19:52 +0200 |
commit | f45891cf2655ebda318833b1ca4d11a451d6f398 (patch) | |
tree | 88ed2dd04bd3913fac206279c78c987e8ad1b14d /udp.c | |
parent | 3bb859c50522e92f01241403501049692f98d25d (diff) | |
download | passt-f45891cf2655ebda318833b1ca4d11a451d6f398.tar passt-f45891cf2655ebda318833b1ca4d11a451d6f398.tar.gz passt-f45891cf2655ebda318833b1ca4d11a451d6f398.tar.bz2 passt-f45891cf2655ebda318833b1ca4d11a451d6f398.tar.lz passt-f45891cf2655ebda318833b1ca4d11a451d6f398.tar.xz passt-f45891cf2655ebda318833b1ca4d11a451d6f398.tar.zst passt-f45891cf2655ebda318833b1ca4d11a451d6f398.zip |
conf, tcp, udp: Add --no-map-gw to disable mapping gateway address to host
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'udp.c')
-rw-r--r-- | udp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |