On 17/10/21 8:00 pm, Viktor Dukhovni wrote:
The feature appears to have been released in an incomplete form.
I don't see any code in Postfix to actually use "known_tcp_ports"
to load the underlying hash table.
Hrmmmm, okay.
Also, while numeric service names work with getaddrinfo(3), I
don't believe they work with with getservbyname(3):
+ if ((sp = getservbyname(filter_known_tcp_port(service), protocol))
!= 0)
+ if ((sp = getservbyname(filter_known_tcp_port(service), protocol))
== 0)
+ if ((sp = getservbyname(filter_known_tcp_port(service), protocol))
== 0)
+ if ((sp = getservbyname(filter_known_tcp_port(service), proto)) != 0)
{
So even when the parameter is properly loaded, only the last two changes
would work as expected.
That makes sense. It seems like we need a wrapper function for
getservbyname() that first checks htable_locate() and if the port exists
there simply creates the servent structure itself with the proper
service data, and if not passes the call onto getservbyname().
Peter