remote: Fix incorrect handling of `port` option
The `port` option is converted from unsigned short integer to
network byte order twice. Unfortunately the 2nd conversion
reverses the 1st one.
Example:
#include <stdio.h>
#include <arpa/inet.h>
#include <stdlib.h>
int main()
{
printf("%d\n", htons(atoi("1234"))); /* 53764 */
printf("%d\n", htons(htons(atoi("1234")))); /* 1234 */
return 0;
}
Signed-off-by:
Radostin Stoyanov <rstoyanov1@gmail.com>
Showing
Please
register
or
sign in
to comment