Merge from vendor branch NCURSES:
[dragonfly.git] / secure / usr.bin / ssh / ssh.c.patch
1 $DragonFly: src/secure/usr.bin/ssh/Attic/ssh.c.patch,v 1.1 2004/07/31 20:05:00 geekgod Exp $
2 --- ssh.c.orig  2004-03-21 23:36:01.000000000 +0100
3 +++ ssh.c       2004-07-23 13:16:14.000000000 +0200
4 @@ -554,6 +554,23 @@
5         if (options.hostname != NULL)
6                 host = options.hostname;
7  
8 +       /* Find canonic host name. */
9 +       if (strchr(host, '.') == 0) {
10 +               struct addrinfo hints;
11 +               struct addrinfo *ai = NULL;
12 +               int errgai;
13 +               memset(&hints, 0, sizeof(hints));
14 +               hints.ai_family = options.address_family;
15 +               hints.ai_flags = AI_CANONNAME;
16 +               hints.ai_socktype = SOCK_STREAM;
17 +               errgai = getaddrinfo(host, NULL, &hints, &ai);
18 +               if (errgai == 0) {
19 +                       if (ai->ai_canonname != NULL)
20 +                               host = xstrdup(ai->ai_canonname);
21 +                       freeaddrinfo(ai);
22 +               }
23 +       }
24 +
25         /* force lowercase for hostkey matching */
26         if (options.host_key_alias != NULL) {
27                 for (p = options.host_key_alias; *p; p++)