From: Greg Hudson Date: Tue, 19 May 2015 14:38:51 +0000 (-0400) Subject: Fix bindresvport_sa port byte swap bug X-Git-Tag: krb5-1.14-alpha1~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F282%2Fhead;p=thirdparty%2Fkrb5.git Fix bindresvport_sa port byte swap bug The sa_setport() helper handles conversion to network byte order, so bindresvport_sa() should not itself call htons() on the port argument. (This bug was introduced in commit 0d04b60d159ab83b943e43802b1449a3b074bc83 when adding bindresvport_sa(). It was my fault, not Andreas Schneider's.) ticket: 8197 (new) target_version: 1.13.3 tags: pullup --- diff --git a/src/lib/rpc/bindresvport.c b/src/lib/rpc/bindresvport.c index ccc4d73c6b..a421dd8ec7 100644 --- a/src/lib/rpc/bindresvport.c +++ b/src/lib/rpc/bindresvport.c @@ -76,7 +76,7 @@ bindresvport_sa(int sd, struct sockaddr *sa) res = -1; errno = EADDRINUSE; for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; i++) { - sa_setport(sa, htons(port++)); + sa_setport(sa, port++); if (port > ENDPORT) { port = STARTPORT; }