Diff for /embedaddon/iperf/src/iperf_util.c between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2021/03/17 00:36:46 version 1.1.1.3, 2023/09/27 11:14:54
Line 128  make_cookie(const char *cookie) Line 128  make_cookie(const char *cookie)
 /* is_closed  /* is_closed
  *   *
  * Test if the file descriptor fd is closed.   * Test if the file descriptor fd is closed.
 *  *
  * Iperf uses this function to test whether a TCP stream socket   * Iperf uses this function to test whether a TCP stream socket
  * is closed, because accepting and denying an invalid connection   * is closed, because accepting and denying an invalid connection
  * in iperf_tcp_accept is not considered an error.   * in iperf_tcp_accept is not considered an error.
Line 176  double Line 176  double
 timeval_diff(struct timeval * tv0, struct timeval * tv1)  timeval_diff(struct timeval * tv0, struct timeval * tv1)
 {  {
     double time1, time2;      double time1, time2;
    
     time1 = tv0->tv_sec + (tv0->tv_usec / 1000000.0);      time1 = tv0->tv_sec + (tv0->tv_usec / 1000000.0);
     time2 = tv1->tv_sec + (tv1->tv_usec / 1000000.0);      time2 = tv1->tv_sec + (tv1->tv_usec / 1000000.0);
   
Line 232  get_system_info(void) Line 232  get_system_info(void)
     memset(buf, 0, 1024);      memset(buf, 0, 1024);
     uname(&uts);      uname(&uts);
   
    snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename,     snprintf(buf, sizeof(buf), "%s %s %s %s %s", uts.sysname, uts.nodename,
              uts.release, uts.version, uts.machine);               uts.release, uts.version, uts.machine);
   
     return buf;      return buf;
Line 249  get_optional_features(void) Line 249  get_optional_features(void)
   
 #if defined(HAVE_CPU_AFFINITY)  #if defined(HAVE_CPU_AFFINITY)
     if (numfeatures > 0) {      if (numfeatures > 0) {
        strncat(features, ", ",         strncat(features, ", ",
                 sizeof(features) - strlen(features) - 1);                  sizeof(features) - strlen(features) - 1);
     }      }
    strncat(features, "CPU affinity setting",     strncat(features, "CPU affinity setting",
         sizeof(features) - strlen(features) - 1);          sizeof(features) - strlen(features) - 1);
     numfeatures++;      numfeatures++;
 #endif /* HAVE_CPU_AFFINITY */  #endif /* HAVE_CPU_AFFINITY */
    
 #if defined(HAVE_FLOWLABEL)  #if defined(HAVE_FLOWLABEL)
     if (numfeatures > 0) {      if (numfeatures > 0) {
        strncat(features, ", ",         strncat(features, ", ",
                 sizeof(features) - strlen(features) - 1);                  sizeof(features) - strlen(features) - 1);
     }      }
    strncat(features, "IPv6 flow label",     strncat(features, "IPv6 flow label",
         sizeof(features) - strlen(features) - 1);          sizeof(features) - strlen(features) - 1);
     numfeatures++;      numfeatures++;
 #endif /* HAVE_FLOWLABEL */  #endif /* HAVE_FLOWLABEL */
    
 #if defined(HAVE_SCTP_H)  #if defined(HAVE_SCTP_H)
     if (numfeatures > 0) {      if (numfeatures > 0) {
        strncat(features, ", ",         strncat(features, ", ",
                 sizeof(features) - strlen(features) - 1);                  sizeof(features) - strlen(features) - 1);
     }      }
    strncat(features, "SCTP",     strncat(features, "SCTP",
         sizeof(features) - strlen(features) - 1);          sizeof(features) - strlen(features) - 1);
     numfeatures++;      numfeatures++;
 #endif /* HAVE_SCTP_H */  #endif /* HAVE_SCTP_H */
    
 #if defined(HAVE_TCP_CONGESTION)  #if defined(HAVE_TCP_CONGESTION)
     if (numfeatures > 0) {      if (numfeatures > 0) {
        strncat(features, ", ",         strncat(features, ", ",
                 sizeof(features) - strlen(features) - 1);                  sizeof(features) - strlen(features) - 1);
     }      }
    strncat(features, "TCP congestion algorithm setting",     strncat(features, "TCP congestion algorithm setting",
         sizeof(features) - strlen(features) - 1);          sizeof(features) - strlen(features) - 1);
     numfeatures++;      numfeatures++;
 #endif /* HAVE_TCP_CONGESTION */  #endif /* HAVE_TCP_CONGESTION */
    
 #if defined(HAVE_SENDFILE)  #if defined(HAVE_SENDFILE)
     if (numfeatures > 0) {      if (numfeatures > 0) {
         strncat(features, ", ",          strncat(features, ", ",
Line 317  get_optional_features(void) Line 317  get_optional_features(void)
     numfeatures++;      numfeatures++;
 #endif /* HAVE_SSL */  #endif /* HAVE_SSL */
   
   #if defined(HAVE_SO_BINDTODEVICE)
       if (numfeatures > 0) {
           strncat(features, ", ",
                   sizeof(features) - strlen(features) - 1);
       }
       strncat(features, "bind to device",
           sizeof(features) - strlen(features) - 1);
       numfeatures++;
   #endif /* HAVE_SO_BINDTODEVICE */
   
   #if defined(HAVE_DONT_FRAGMENT)
       if (numfeatures > 0) {
           strncat(features, ", ",
                   sizeof(features) - strlen(features) - 1);
       }
       strncat(features, "support IPv4 don't fragment",
           sizeof(features) - strlen(features) - 1);
       numfeatures++;
   #endif /* HAVE_DONT_FRAGMENT */
   
     if (numfeatures == 0) {      if (numfeatures == 0) {
        strncat(features, "None",         strncat(features, "None",
                 sizeof(features) - strlen(features) - 1);                  sizeof(features) - strlen(features) - 1);
     }      }
   
Line 456  int daemon(int nochdir, int noclose) Line 476  int daemon(int nochdir, int noclose)
   
     /*      /*
      * Fork again to avoid becoming a session leader.       * Fork again to avoid becoming a session leader.
     * This might only matter on old SVr4-derived OSs.      * This might only matter on old SVr4-derived OSs.
     * Note in particular that glibc and FreeBSD libc      * Note in particular that glibc and FreeBSD libc
      * only fork once.       * only fork once.
      */       */
     pid = fork();      pid = fork();

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>