mirror of
https://passt.top/passt
synced 2025-01-18 10:25:17 +00:00
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>
This commit is contained in:
parent
e58828f340
commit
ecf1f97564
3
udp.c
3
udp.c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user