[BACK]Return to inet.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / netstat

Diff for /src/usr.bin/netstat/inet.c between version 1.134 and 1.135

version 1.134, 2014/08/14 12:55:50 version 1.135, 2014/10/23 16:45:57
Line 801 
Line 801 
         char *cp;          char *cp;
         static char line[50];          static char line[50];
         struct hostent *hp;          struct hostent *hp;
         struct netent *np;  
         static char domain[MAXHOSTNAMELEN];          static char domain[MAXHOSTNAMELEN];
         static int first = 1;          static int first = 1;
   
Line 818 
Line 817 
                 int net = inet_netof(*inp);                  int net = inet_netof(*inp);
                 int lna = inet_lnaof(*inp);                  int lna = inet_lnaof(*inp);
   
                 if (lna == INADDR_ANY) {                  hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET);
                         np = getnetbyaddr(net, AF_INET);                  if (hp) {
                         if (np)                          if ((cp = strchr(hp->h_name, '.')) &&
                                 cp = np->n_name;                              !strcmp(cp + 1, domain))
                 }                                  *cp = '\0';
                 if (cp == NULL) {                          cp = hp->h_name;
                         hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET);  
                         if (hp) {  
                                 if ((cp = strchr(hp->h_name, '.')) &&  
                                     !strcmp(cp + 1, domain))  
                                         *cp = '\0';  
                                 cp = hp->h_name;  
                         }  
                 }                  }
         }          }
         if (inp->s_addr == INADDR_ANY)          if (inp->s_addr == INADDR_ANY)

Legend:
Removed from v.1.134  
changed lines
  Added in v.1.135