Merge commit from fork

avoid cross IP version feeds
This commit is contained in:
Sergio R. Caprile authored and GitHub committed 2026-11-09 11:18:41 -03:00
commit b6ba6a56d9
2 files changed
+2

No files matched your search

+1
View File
@@ -602,6 +602,7 @@ static struct mg_connection *getpeer(struct mg_mgr *mgr, struct pkt *pkt,
if (!c->is_udp && pkt->tcp && c->loc.port == pkt->tcp->dport &&
((lsn && c->is_listening && !(c->loc.is_ip6 ^ (pkt->ip6 != NULL))) ||
(!lsn && !c->is_listening && c->rem.port == pkt->tcp->sport &&
!(c->loc.is_ip6 ^ (pkt->ip6 != NULL)) && // IP or IPv6 to same dest
((!c->loc.is_ip6 && c->rem.addr.ip4 == pkt->ip->src)
#if MG_ENABLE_IPV6
|| (c->loc.is_ip6 && MG_IP6MATCH(c->rem.addr.ip6, pkt->ip6->src))