Skip to content
Snippets Groups Projects
Commit 30f19ee3 authored by rswindell's avatar rswindell
Browse files

Improvement on previous commit: if service/protocol name isn't found for UDP

(e.g. finger), then try TCP (and vice versa).
parent 5c758d9f
No related branches found
No related tags found
No related merge requests found
......@@ -1501,6 +1501,8 @@ static service_t* read_services_ini(service_t* service, DWORD* services)
serv.port=(ushort)strtol(p,NULL,0);
else {
struct servent* servent = getservbyname(p,serv.options&SERVICE_OPT_UDP ? "udp":"tcp");
if(servent==NULL)
servent = getservbyname(p,serv.options&SERVICE_OPT_UDP ? "tcp":"udp");
if(servent!=NULL)
serv.port = ntohs(servent->s_port);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment