[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.104 and 1.105

version 1.104, 2007/12/19 01:47:00 version 1.105, 2008/02/05 16:14:31
Line 118 
Line 118 
         struct inpcbtable table;          struct inpcbtable table;
         struct inpcb *head, *next, *prev;          struct inpcb *head, *next, *prev;
         struct inpcb inpcb;          struct inpcb inpcb;
         int istcp, israw;          int istcp, israw, isany;
         int first = 1;          int first = 1;
         char *name0;          char *name0;
         char namebuf[20];          char namebuf[20];
Line 146 
Line 146 
                 case AF_INET:                  case AF_INET:
                         if ((inpcb.inp_flags & INP_IPV6) != 0)                          if ((inpcb.inp_flags & INP_IPV6) != 0)
                                 continue;                                  continue;
                           isany = inet_lnaof(inpcb.inp_faddr) == INADDR_ANY;
                         break;                          break;
                 case AF_INET6:                  case AF_INET6:
                         if ((inpcb.inp_flags & INP_IPV6) == 0)                          if ((inpcb.inp_flags & INP_IPV6) == 0)
                                 continue;                                  continue;
                           isany = IN6_IS_ADDR_UNSPECIFIED(&inpcb.inp_faddr6);
                         break;                          break;
                 default:                  default:
                           isany = 0;
                         break;                          break;
                 }                  }
   
                 if (!aflag &&  
                     inet_lnaof(inpcb.inp_laddr) == INADDR_ANY)  
                         continue;  
                 kread((u_long)inpcb.inp_socket, &sockb, sizeof (sockb));                  kread((u_long)inpcb.inp_socket, &sockb, sizeof (sockb));
                 if (istcp) {                  if (istcp) {
                         kread((u_long)inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb));                          kread((u_long)inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb));
                 }                          if (!aflag && tcpcb.t_state <= TCPS_LISTEN)
                                   continue;
                   } else if (!aflag && isany)
                           continue;
                 if (first) {                  if (first) {
                         printf("Active Internet connections");                          printf("Active Internet connections");
                         if (aflag)                          if (aflag)

Legend:
Removed from v.1.104  
changed lines
  Added in v.1.105