mirror of
https://github.com/3proxy/3proxy.git
synced 2026-05-13 13:30:12 +08:00
Use UDPMAP request address to limit client, not server
This commit is contained in:
parent
ff7f4b8ea6
commit
7a139e59a5
@ -111,6 +111,11 @@ int udpsockmap(struct clientparam *param, int timeo)
|
|||||||
memcmp(SAADDR(&sin), SAADDR(¶m->sincr), SAADDRLEN(&sin)))
|
memcmp(SAADDR(&sin), SAADDR(¶m->sincr), SAADDRLEN(&sin)))
|
||||||
continue;
|
continue;
|
||||||
if (firstpacket) {
|
if (firstpacket) {
|
||||||
|
if (!SAISNULL(¶m->req) && *SAPORT(¶m->req) &&
|
||||||
|
SAADDRLEN(¶m->req) == SAADDRLEN(&sin) &&
|
||||||
|
!memcmp(SAADDR(¶m->req), SAADDR(&sin), SAADDRLEN(¶m->req)) &&
|
||||||
|
memcmp(SAPORT(¶m->req), SAPORT(&sin), 2))
|
||||||
|
continue;
|
||||||
param->sincr = sin;
|
param->sincr = sin;
|
||||||
firstpacket = 0;
|
firstpacket = 0;
|
||||||
} else if (memcmp(SAPORT(&sin), SAPORT(¶m->sincr), 2)) {
|
} else if (memcmp(SAPORT(&sin), SAPORT(¶m->sincr), 2)) {
|
||||||
@ -184,13 +189,6 @@ int udpsockmap(struct clientparam *param, int timeo)
|
|||||||
memcmp(SAPORT(&from), SAPORT(¶m->sinsr), 2))
|
memcmp(SAPORT(&from), SAPORT(¶m->sinsr), 2))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (!SAISNULL(¶m->req) && *SAPORT(¶m->req)) {
|
|
||||||
if (SAADDRLEN(&from) != SAADDRLEN(¶m->req) ||
|
|
||||||
memcmp(SAADDR(&from), SAADDR(¶m->req), SAADDRLEN(&from)) ||
|
|
||||||
memcmp(SAPORT(&from), SAPORT(¶m->req), 2))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
param->statssrv64 += len;
|
param->statssrv64 += len;
|
||||||
param->nreads++;
|
param->nreads++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user