diff options
author | Greg Hudson <ghudson@mit.edu> | 2015-05-19 10:38:51 -0400 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2015-06-24 18:07:59 -0400 |
commit | 98cf93e21747cc6641475410ccc9f1ba3e17c162 (patch) | |
tree | 314ac2784e9d8510be79bb3ef484e552fe7019a7 | |
parent | a1cd5091b1e4cebd94b86e8c76ce2eadafb500a5 (diff) | |
download | krb5-98cf93e21747cc6641475410ccc9f1ba3e17c162.zip krb5-98cf93e21747cc6641475410ccc9f1ba3e17c162.tar.gz krb5-98cf93e21747cc6641475410ccc9f1ba3e17c162.tar.bz2 |
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.)
(cherry picked from commit 5c6d218e385755766ff427b3e707510f0ce175c5)
ticket: 8197
version_fixed: 1.13.3
status: resolved
-rw-r--r-- | src/lib/rpc/bindresvport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/rpc/bindresvport.c b/src/lib/rpc/bindresvport.c index ccc4d73..a421dd8 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; } |