Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forkserver: --max-from-ip/max_conn_ip not working when no specific listening interface is defined #315

Open
wornet-aer opened this issue Nov 16, 2023 · 0 comments

Comments

@wornet-aer
Copy link
Contributor

Today I discovered a strange behaviour:
qpsmtpd was not blocking too many connections from the same ip address, even with --limit-connections=60 --max-from-ip=6 specified. The overall maximum connection limit of 60 was correctly respected though. I was having the hosts_allow plugin enable and didn't need to change much to fix it: I just had to explicitly specify the public ip address of my system instead of leaving --listen-address empty.

I'm not sure yet, if this is a bug within the forkserver or the plugin. The hosts_allow plugin recognizes every connection as the first one of the client host, which means the wrong behaviour has to do with the following lines:

my $num_conn = 1; # seed with current value
my $raddr = inet_aton($remote);
foreach my $rip (@{$args{child_addrs}}) {
++$num_conn if (defined $rip && $rip eq $raddr);
}

Maybe $args{child_addrs} is not correctly filled when having no specific listening interface defined?

Any thougths, hints or tips are appreciated! :-)

Cheers
Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant