diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-09-09 15:30:12 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-09-09 15:40:04 +0200 |
commit | ecf1f975641806755a6a1f3814bbee154f187d75 (patch) | |
tree | 8d66c802b80a90ec4a228d9d1e1fe68b95842c50 | |
parent | e58828f3406741afbeb866edf19d57bb81a5275a (diff) | |
download | passt-ecf1f975641806755a6a1f3814bbee154f187d75.tar passt-ecf1f975641806755a6a1f3814bbee154f187d75.tar.gz passt-ecf1f975641806755a6a1f3814bbee154f187d75.tar.bz2 passt-ecf1f975641806755a6a1f3814bbee154f187d75.tar.lz passt-ecf1f975641806755a6a1f3814bbee154f187d75.tar.xz passt-ecf1f975641806755a6a1f3814bbee154f187d75.tar.zst passt-ecf1f975641806755a6a1f3814bbee154f187d75.zip |
udp: Fix comparison of seen IPv4 address for local connections
c->addr4_seen is stored in network order.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | udp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -761,7 +761,8 @@ void udp_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events, s_addr = ntohl(b->s_in.sin_addr.s_addr); if (s_addr >> IN_CLASSA_NSHIFT == IN_LOOPBACKNET || - s_addr == INADDR_ANY || s_addr == c->addr4_seen) { + s_addr == INADDR_ANY || + s_addr == ntohl(c->addr4_seen)) { in_port_t src = htons(b->s_in.sin_port); b->iph.saddr = c->gw4; |