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

Diff for /src/usr.bin/tcpbench/tcpbench.c between version 1.65 and 1.66

version 1.65, 2021/07/12 15:09:20 version 1.66, 2022/08/06 23:35:30
Line 331 
Line 331 
         socklen_t melen, themlen;          socklen_t melen, themlen;
         struct sockaddr_in *in4;          struct sockaddr_in *in4;
         struct sockaddr_in6 *in6;          struct sockaddr_in6 *in6;
         char tmp1[64], tmp2[64];  
         int nretry;          int nretry;
   
         nretry = 10;          nretry = 10;
Line 345 
Line 344 
         if (me.ss_family != AF_INET && me.ss_family != AF_INET6)          if (me.ss_family != AF_INET && me.ss_family != AF_INET6)
                 errx(1, "%s: unknown socket family", __func__);                  errx(1, "%s: unknown socket family", __func__);
         if (ptb->vflag >= 2) {          if (ptb->vflag >= 2) {
                   char tmp1[NI_MAXHOST + 2 + NI_MAXSERV];
                   char tmp2[NI_MAXHOST + 2 + NI_MAXSERV];
   
                 saddr_ntop((struct sockaddr *)&me, me.ss_len,                  saddr_ntop((struct sockaddr *)&me, me.ss_len,
                     tmp1, sizeof(tmp1));                      tmp1, sizeof(tmp1));
                 saddr_ntop((struct sockaddr *)&them, them.ss_len,                  saddr_ntop((struct sockaddr *)&them, them.ss_len,
Line 385 
Line 387 
                                 continue;                                  continue;
                         }                          }
                         if (ptb->vflag >= 2) {                          if (ptb->vflag >= 2) {
                                   char tmp1[NI_MAXHOST];
                                   char tmp2[NI_MAXHOST];
   
                                 inet_ntop(AF_INET, &inpcb.inp_laddr,                                  inet_ntop(AF_INET, &inpcb.inp_laddr,
                                     tmp1, sizeof(tmp1));                                      tmp1, sizeof(tmp1));
                                 inet_ntop(AF_INET, &inpcb.inp_faddr,                                  inet_ntop(AF_INET, &inpcb.inp_faddr,
Line 408 
Line 413 
                         if ((inpcb.inp_flags & INP_IPV6) == 0)                          if ((inpcb.inp_flags & INP_IPV6) == 0)
                                 continue;                                  continue;
                         if (ptb->vflag >= 2) {                          if (ptb->vflag >= 2) {
                                   char tmp1[NI_MAXHOST];
                                   char tmp2[NI_MAXHOST];
   
                                 inet_ntop(AF_INET6, &inpcb.inp_laddr6,                                  inet_ntop(AF_INET6, &inpcb.inp_laddr6,
                                     tmp1, sizeof(tmp1));                                      tmp1, sizeof(tmp1));
                                 inet_ntop(AF_INET6, &inpcb.inp_faddr6,                                  inet_ntop(AF_INET6, &inpcb.inp_faddr6,
Line 780 
Line 788 
         struct statctx *sc;          struct statctx *sc;
         struct sockaddr_storage ss;          struct sockaddr_storage ss;
         socklen_t sslen;          socklen_t sslen;
         char tmp[128];          char tmp[NI_MAXHOST + 2 + NI_MAXSERV];
   
         sslen = sizeof(ss);          sslen = sizeof(ss);
   
Line 838 
Line 846 
 static void  static void
 server_init(struct addrinfo *aitop)  server_init(struct addrinfo *aitop)
 {  {
         char tmp[128];  
         int sock, on = 1;          int sock, on = 1;
         struct addrinfo *ai;          struct addrinfo *ai;
         struct event *ev;          struct event *ev;
Line 847 
Line 854 
   
         lnfds = 0;          lnfds = 0;
         for (ai = aitop; ai != NULL; ai = ai->ai_next) {          for (ai = aitop; ai != NULL; ai = ai->ai_next) {
                   char tmp[NI_MAXHOST + 2 + NI_MAXSERV];
   
                 saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp, sizeof(tmp));                  saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp, sizeof(tmp));
                 if (ptb->vflag)                  if (ptb->vflag)
                         fprintf(stderr, "Try to bind to %s\n", tmp);                          fprintf(stderr, "Try to bind to %s\n", tmp);
Line 959 
Line 968 
 {  {
         struct statctx *sc;          struct statctx *sc;
         struct addrinfo *ai;          struct addrinfo *ai;
         char tmp[128];  
         int i, r, sock;          int i, r, sock;
   
         for (i = 0; i < nconn; i++) {          for (i = 0; i < nconn; i++) {
                 for (sock = -1, ai = aitop; ai != NULL; ai = ai->ai_next) {                  for (sock = -1, ai = aitop; ai != NULL; ai = ai->ai_next) {
                           char tmp[NI_MAXHOST + 2 + NI_MAXSERV];
   
                         saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp,                          saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp,
                             sizeof(tmp));                              sizeof(tmp));
                         if (ptb->vflag && i == 0)                          if (ptb->vflag && i == 0)

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.66