]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix bindresvport_sa port byte swap bug 282/head
authorGreg Hudson <ghudson@mit.edu>
Tue, 19 May 2015 14:38:51 +0000 (10:38 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 3 Jun 2015 22:50:59 +0000 (18:50 -0400)
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

src/lib/rpc/bindresvport.c

index ccc4d73c6b1ae3e354c66867b1a8329c3fafbed0..a421dd8ec770a307ba2714a9a105f73ab346bdcf 100644 (file)
@@ -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;
                }