You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ARES_OPT_UDP_PORT unsigned short udp_port;
The port to use for queries over UDP, in network byte order. The default value is 53 (in network byte order), the standard name service port.
Yet, the code says:
// NOTE: c-ares is assuming `options->udp_port` is in host byte order!
if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1)
channel->udp_port = htons(options->udp_port);
The text was updated successfully, but these errors were encountered:
I haven't looked into this, but did you confirm via testing the docs are wrong, or did you just happen to glance at the code?
The reason I ask is there are quite a few usages of htons and ntohs in the c-ares code involving ports, so it could be swapping twice which would mean the docs could be right.
As per #487, documentation states the port should be in network byte
order, but we can see from the test cases using MockServers on
different ports that this is not the case, it is definitely in host
byte order.
Fix By: Brad House (@bradh352)
The documentation says:
Yet, the code says:
The text was updated successfully, but these errors were encountered: