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

Diff for /src/usr.bin/netstat/if.c between version 1.42 and 1.43

version 1.42, 2005/03/13 16:05:50 version 1.43, 2005/03/25 17:01:03
Line 106 
Line 106 
          * the pointer to the TAILQ_HEAD with the actual pointer           * the pointer to the TAILQ_HEAD with the actual pointer
          * to the first list element.           * to the first list element.
          */           */
         if (kread(ifnetaddr, (char *)&ifhead, sizeof ifhead))          if (kread(ifnetaddr, &ifhead, sizeof ifhead))
                 return;                  return;
         ifnetaddr = (u_long)ifhead.tqh_first;          ifnetaddr = (u_long)ifhead.tqh_first;
   
Line 132 
Line 132 
                 int n, m;                  int n, m;
   
                 if (ifaddraddr == 0) {                  if (ifaddraddr == 0) {
                         if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet))                          if (kread(ifnetaddr, &ifnet, sizeof ifnet))
                                 return;                                  return;
                         bcopy(ifnet.if_xname, name, IFNAMSIZ);                          bcopy(ifnet.if_xname, name, IFNAMSIZ);
                         name[IFNAMSIZ - 1] = '\0';      /* sanity */                          name[IFNAMSIZ - 1] = '\0';      /* sanity */
Line 166 
Line 166 
                         printf("%-11.11s ", "none");                          printf("%-11.11s ", "none");
                         printf("%-17.17s ", "none");                          printf("%-17.17s ", "none");
                 } else {                  } else {
                         if (kread(ifaddraddr, (char *)&ifaddr, sizeof ifaddr)) {                          if (kread(ifaddraddr, &ifaddr, sizeof ifaddr)) {
                                 ifaddraddr = 0;                                  ifaddraddr = 0;
                                 continue;                                  continue;
                         }                          }
Line 210 
Line 210 
   
                                         multiaddr = (u_long)ifaddr.in.ia_multiaddrs.lh_first;                                          multiaddr = (u_long)ifaddr.in.ia_multiaddrs.lh_first;
                                         while (multiaddr != 0) {                                          while (multiaddr != 0) {
                                                 kread(multiaddr, (char *)&inm,                                                  kread(multiaddr, &inm, sizeof inm);
                                                     sizeof inm);  
                                                 printf("\n%25s %-17.17s ", "",                                                  printf("\n%25s %-17.17s ", "",
                                                     routename(inm.inm_addr.s_addr));                                                      routename(inm.inm_addr.s_addr));
                                                 multiaddr = (u_long)inm.inm_list.le_next;                                                  multiaddr = (u_long)inm.inm_list.le_next;
Line 250 
Line 249 
   
                                         multiaddr = (u_long)ifaddr.in6.ia6_multiaddrs.lh_first;                                          multiaddr = (u_long)ifaddr.in6.ia6_multiaddrs.lh_first;
                                         while (multiaddr != 0) {                                          while (multiaddr != 0) {
                                                 kread(multiaddr, (char *)&inm,                                                  kread(multiaddr, &inm, sizeof inm);
                                                     sizeof inm);  
                                                 memset(&m6, 0, sizeof(m6));                                                  memset(&m6, 0, sizeof(m6));
                                                 m6.sin6_len = sizeof(struct sockaddr_in6);                                                  m6.sin6_len = sizeof(struct sockaddr_in6);
                                                 m6.sin6_family = AF_INET6;                                                  m6.sin6_family = AF_INET6;
Line 401 
Line 399 
          * the pointer to the TAILQ_HEAD with the actual pointer           * the pointer to the TAILQ_HEAD with the actual pointer
          * to the first list element.           * to the first list element.
          */           */
         if (kread(off, (char *)&ifhead, sizeof ifhead))          if (kread(off, &ifhead, sizeof ifhead))
                 return;                  return;
         firstifnet = (u_long)ifhead.tqh_first;          firstifnet = (u_long)ifhead.tqh_first;
   
Line 410 
Line 408 
         total = sum - 1;          total = sum - 1;
         interesting = (interface == NULL) ? iftot : NULL;          interesting = (interface == NULL) ? iftot : NULL;
         for (off = firstifnet, ip = iftot; off;) {          for (off = firstifnet, ip = iftot; off;) {
                 if (kread(off, (char *)&ifnet, sizeof ifnet))                  if (kread(off, &ifnet, sizeof ifnet))
                         break;                          break;
                 bzero(ip->ift_name, sizeof(ip->ift_name));                  bzero(ip->ift_name, sizeof(ip->ift_name));
                 snprintf(ip->ift_name, IFNAMSIZ, "%s", ifnet.if_xname);                  snprintf(ip->ift_name, IFNAMSIZ, "%s", ifnet.if_xname);
Line 494 
Line 492 
         sum->ift_co = 0;          sum->ift_co = 0;
         sum->ift_dr = 0;          sum->ift_dr = 0;
         for (off = firstifnet, ip = iftot; off && ip < lastif; ip++) {          for (off = firstifnet, ip = iftot; off && ip < lastif; ip++) {
                 if (kread(off, (char *)&ifnet, sizeof ifnet)) {                  if (kread(off, &ifnet, sizeof ifnet)) {
                         off = 0;                          off = 0;
                         continue;                          continue;
                 }                  }

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43