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

Diff for /src/usr.bin/netstat/show.c between version 1.40 and 1.41

version 1.40, 2013/11/21 17:32:13 version 1.41, 2014/04/17 15:36:53
Line 31 
Line 31 
  */   */
   
 #include <sys/param.h>  #include <sys/param.h>
 #include <sys/protosw.h>  
 #include <sys/socket.h>  #include <sys/socket.h>
 #include <sys/sysctl.h>  #include <sys/sysctl.h>
   
 #include <net/if.h>  #include <net/if.h>
 #include <net/if_var.h>  
 #include <net/if_dl.h>  #include <net/if_dl.h>
 #include <net/if_types.h>  #include <net/if_types.h>
 #include <net/pfkeyv2.h>  #include <net/pfkeyv2.h>
Line 98 
Line 96 
         { 0 }          { 0 }
 };  };
   
   int      WID_DST(int);
 void     p_rtentry(struct rt_msghdr *);  void     p_rtentry(struct rt_msghdr *);
 void     p_pfkentry(struct sadb_msg *);  void     p_pfkentry(struct sadb_msg *);
 void     pr_family(int);  void     pr_family(int);
Line 213 
Line 212 
  */   */
 #define WID_GW(af)      ((af) == AF_INET6 ? (nflag ? 30 : 18) : 18)  #define WID_GW(af)      ((af) == AF_INET6 ? (nflag ? 30 : 18) : 18)
   
 static int  int
 WID_DST(int af)  WID_DST(int af)
 {  {
   
Line 296 
Line 295 
                 return;                  return;
   
         get_rtaddrs(rtm->rtm_addrs, sa, rti_info);          get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
   
         if (Fflag && rti_info[RTAX_GATEWAY]->sa_family != sa->sa_family) {          if (Fflag && rti_info[RTAX_GATEWAY]->sa_family != sa->sa_family) {
                 return;                  return;
         }          }
Line 400 
Line 400 
         case AF_MPLS:          case AF_MPLS:
                 afname = "MPLS";                  afname = "MPLS";
                 break;                  break;
         case AF_APPLETALK:  
                 afname = "AppleTalk";  
                 break;  
         default:          default:
                 afname = NULL;                  afname = NULL;
                 break;                  break;
Line 761 
Line 758 
         if (mask) {          if (mask) {
                 lim = mask->sin6_len - offsetof(struct sockaddr_in6, sin6_addr);                  lim = mask->sin6_len - offsetof(struct sockaddr_in6, sin6_addr);
                 lim = lim < (int)sizeof(struct in6_addr) ?                  lim = lim < (int)sizeof(struct in6_addr) ?
                     lim : sizeof(struct in6_addr);                      lim : (int)sizeof(struct in6_addr);
                 for (p = (u_char *)&mask->sin6_addr, i = 0; i < lim; p++) {                  for (p = (u_char *)&mask->sin6_addr, i = 0; i < lim; p++) {
                         if (final && *p) {                          if (final && *p) {
                                 illegal++;                                  illegal++;
Line 815 
Line 812 
                         else                          else
                                 sin6.sin6_addr.s6_addr[i++] = 0x00;                                  sin6.sin6_addr.s6_addr[i++] = 0x00;
                 }                  }
                 while (i < sizeof(struct in6_addr))                  while (i < (int)sizeof(struct in6_addr))
                         sin6.sin6_addr.s6_addr[i++] = 0x00;                          sin6.sin6_addr.s6_addr[i++] = 0x00;
         } else          } else
                 masklen = 128;                  masklen = 128;

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41