When passing as service a string representing a number higher than 65535, getaddrinfo() should complain and reject the translation by returning an error. Unfortunately the current behaviour consist in decoding the string to int and extracting the lower 16 bits to be used as sin_port. For example, when passing "70000" as service, the string is decoded as 70000 (0x11170) and then saved as 4464 (0x1170).
I just realized this is a duplicate of #16208
Dupe then. Thanks. *** This bug has been marked as a duplicate of bug 16208 ***