[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.159 and 1.160

version 1.159, 2017/07/27 19:59:46 version 1.160, 2017/08/12 03:21:02
Line 294 
Line 294 
         }          }
   
         /* filter listening sockets out unless -a is set */          /* filter listening sockets out unless -a is set */
         if (!aflag && istcp && kf->t_state <= TCPS_LISTEN)          if (!(aflag || lflag) && istcp && kf->t_state <= TCPS_LISTEN)
                 return;                  return;
         else if (!aflag && isany)          else if (!(aflag || lflag) && isany)
                 return;                  return;
   
           /* when -l is set, show only listening sockets */
           if (!aflag && lflag && istcp &&
               kf->t_state != TCPS_LISTEN)
                   return;
   
         if (af != kf->so_family || type != kf->so_type) {          if (af != kf->so_family || type != kf->so_type) {
                 af = kf->so_family;                  af = kf->so_family;
                 type = kf->so_type;                  type = kf->so_type;
                 printf("Active Internet connections");                  printf("Active Internet connections");
                 if (aflag)                  if (aflag)
                         printf(" (including servers)");                          printf(" (including servers)");
                   else if (lflag)
                           printf(" (only servers)");
                 putchar('\n');                  putchar('\n');
                 if (Aflag) {                  if (Aflag) {
                         addrlen = 18;                          addrlen = 18;

Legend:
Removed from v.1.159  
changed lines
  Added in v.1.160