fix up the paranoid code to make it work with ipv6.

This commit is contained in:
Love Hornquist Astrand
2009-07-16 22:21:59 -07:00
parent 3634423f36
commit 3c053a2e09

View File

@@ -155,11 +155,11 @@ cmd
{ {
if ($5) { if ($5) {
if (paranoid && if (paranoid &&
(data_dest->sa_family != AF_INET || (data_dest->sa_family != his_addr->sa_family ||
(ntohs(data_dest->sin_port) < IPPORT_RESERVED) || (socket_get_port(data_dest) < IPPORT_RESERVED) ||
memcmp(data_dest->sin_addr, memcmp(socket_get_address(data_dest),
&his_addr->sin_addr, socket_get_address(his_addr),
sizeof(data_dest.sin_addr)) != 0)) { socket_addr_size(his_addr)) != 0)) {
usedefault = 1; usedefault = 1;
reply(500, "Illegal PORT range rejected."); reply(500, "Illegal PORT range rejected.");
} else { } else {