0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::net::dns: Log an error for an unknown service port.

This commit is contained in:
Jason Volk 2020-03-15 19:25:28 -07:00
parent 83b7e0b9b1
commit 59dea0c8bb

View file

@ -598,6 +598,14 @@ try
assert(!ent || ent->s_port != 0);
assert(!ent || name == ent->s_name);
assert(!ent || !prot || prot == ent->s_proto);
if(unlikely(!ent || !ent->s_port))
log::error
{
log, "Uknown service %s/%s; please add port number to /etc/services",
name,
prot?: "*"_sv
};
return ent?
htons(ent->s_port):
0U;