I'm using NIS under SuSE linux to publish services on the LAN.
The getservbyport function expects a network byte order port number.
If nsswitch.conf contains the line: "services: files nis". The lookup
gets rather unreliable. Apparently, the NIS lookup is doing some
unsollicited byte order swap (htons).
E.g. if port is 12AB and the services list do not include 12AB, it may
return the service name for port AB12 instead of an error.
After removing the nis entry in nsswitch.conf, all works fine.
I assume it is a bug. Anybody?