Bugzilla – Attachment 2483 Details for
Bug 2286
Port ignored when re-reading config after canonicalization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Reset port number in canonicalised address list
fix-addrinfo-port.diff (text/plain), 1.18 KB, created by
Damien Miller
on 2014-10-07 10:03:30 AEDT
(
hide
)
Description:
Reset port number in canonicalised address list
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2014-10-07 10:03:30 AEDT
Size:
1.18 KB
patch
obsolete
>Index: ssh.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh.c,v >retrieving revision 1.407 >diff -u -p -r1.407 ssh.c >--- ssh.c 17 Jul 2014 07:22:19 -0000 1.407 >+++ ssh.c 6 Oct 2014 23:01:18 -0000 >@@ -394,6 +394,26 @@ process_config_files(struct passwd *pw) > } > } > >+/* Rewrite the port number in an addrinfo list of addresses */ >+static void >+set_addrinfo_port(struct addrinfo *addrs, int port) >+{ >+ struct addrinfo *addr; >+ >+ for (addr = addrs; addr != NULL; addr = addr->ai_next) { >+ switch (addr->ai_family) { >+ case AF_INET: >+ ((struct sockaddr_in *)addr->ai_addr)-> >+ sin_port = htons(port); >+ break; >+ case AF_INET6: >+ ((struct sockaddr_in6 *)addr->ai_addr)-> >+ sin6_port = htons(port); >+ break; >+ } >+ } >+} >+ > /* > * Main program for the ssh client. > */ >@@ -922,6 +942,9 @@ main(int ac, char **av) > if (strcasecmp(host_arg, host) != 0) { > debug("Hostname has changed; re-reading configuration"); > process_config_files(pw); >+ /* Port number may have changed, so reset it in address list */ >+ if (addrs != NULL && options.port > 0) >+ set_addrinfo_port(addrs, options.port); > } > > /* Fill configuration defaults. */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2286
:
2482
| 2483