[netperf-dev] netperf2 commit notice r267 - in trunk: . src

raj at netperf.org raj at netperf.org
Tue Mar 18 16:14:48 PDT 2008


Author: raj
Date: 2008-03-18 16:14:47 -0700 (Tue, 18 Mar 2008)
New Revision: 267

Modified:
   trunk/config.h.in
   trunk/configure
   trunk/configure.ac
   trunk/src/netrt_rtmget.c
   trunk/src/netsys_hpux11i.c
   trunk/src/nettest_omni.c
Log:
here a fix there a fix

Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in	2008-03-18 21:08:56 UTC (rev 266)
+++ trunk/config.h.in	2008-03-18 23:14:47 UTC (rev 267)
@@ -214,6 +214,9 @@
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#undef HAVE_SYS_SOCKIO_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 

Modified: trunk/configure
===================================================================
--- trunk/configure	2008-03-18 21:08:56 UTC (rev 266)
+++ trunk/configure	2008-03-18 23:14:47 UTC (rev 267)
@@ -4419,7 +4419,8 @@
 
 
 
-for ac_header in arpa/inet.h endian.h errno.h fcntl.h limits.h malloc.h netdb.h netinet/in.h signal.h stdlib.h string.h strings.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h unistd.h ifaddrs.h
+
+for ac_header in arpa/inet.h endian.h errno.h fcntl.h limits.h malloc.h netdb.h netinet/in.h signal.h stdlib.h string.h strings.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h unistd.h ifaddrs.h sys/sockio.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-03-18 21:08:56 UTC (rev 266)
+++ trunk/configure.ac	2008-03-18 23:14:47 UTC (rev 267)
@@ -31,7 +31,7 @@
 # Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([arpa/inet.h endian.h errno.h fcntl.h limits.h malloc.h netdb.h netinet/in.h signal.h stdlib.h string.h strings.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h unistd.h ifaddrs.h])
+AC_CHECK_HEADERS([arpa/inet.h endian.h errno.h fcntl.h limits.h malloc.h netdb.h netinet/in.h signal.h stdlib.h string.h strings.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/time.h unistd.h ifaddrs.h sys/sockio.h])
 
 # Some platforms require these.  There may be a better way.
 AC_HAVE_LIBRARY(socket)

Modified: trunk/src/netrt_rtmget.c
===================================================================
--- trunk/src/netrt_rtmget.c	2008-03-18 21:08:56 UTC (rev 266)
+++ trunk/src/netrt_rtmget.c	2008-03-18 23:14:47 UTC (rev 267)
@@ -1,3 +1,7 @@
+#if defined(HAVE_CONFIG_H)
+#include <config.h>
+#endif
+
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -93,7 +97,10 @@
 #ifdef AF_INET6
   sin6 = (struct sockaddr_in6 *)sin;
 #endif
+
+#if defined(NETPERF_STANDALONE_DEBUG)
   printf("Looking for %s\n",inet_ntoa(sin->sin_addr));
+#endif
 
   sockfd = socket(AF_INET,SOCK_DGRAM,0);
   if (sockfd < 0)
@@ -150,13 +157,15 @@
       len = sizeof(struct sockaddr_in);
       break;
     }
-
+    
+#if defined(NETPERF_STANDALONE_DEBUG)
     printf("hello i am interface %s family %d\n",
 	   ifr->ifr_name,
 	   ifr->ifr_addr.sa_family);
-
+#endif
+    
     ptr += sizeof(ifr->ifr_name) + len;
-
+    
     if (ifr->ifr_addr.sa_family != sin->sin_family)
       continue;
     else {
@@ -172,14 +181,14 @@
 	if (flagsreq.ifr_flags & IFF_UP) {
 #if defined(NETPERF_STANDALONE_DEBUG)
 	  printf("Interface name %s family %d\n",ifr->ifr_name,ifr->ifr_addr.sa_family);
+#endif
 	  close(sockfd);
 	  /* we should probably close the memory leak one of these days */
 	  return strdup(ifr->ifr_name);
 	}
-#endif
       }
     }
-  }    
+  }
   close(sockfd);
   free(buf);
   return strdup("EgressByAddr");
@@ -188,30 +197,35 @@
 
 #if defined(AF_LINK)
 char *
-find_egress_interface_by_link(struct sockaddr_dl *link) {
+find_egress_interface_by_link(struct sockaddr_dl *socklink) {
 
   char buffer[IF_NAMESIZE];
   char *cret;
 
 #if defined(NETPERF_STANDALONE_DEBUG)
-  printf("link asdf index %d nlen %d alen %d slen %d\n",
-	 link->sdl_index,
-	 link->sdl_nlen,
-	 link->sdl_alen,
-	 link->sdl_slen);
+  printf("socklink asdf index %d nlen %d alen %d slen %d\n",
+	 socklink->sdl_index,
+	 socklink->sdl_nlen,
+	 socklink->sdl_alen,
+	 socklink->sdl_slen);
 #endif
 
   /* I suspect we could extract the name from the sockaddr_dl
      directly, and perhaps should, but I really don't like mucking
      about with pointers and offsets and characters so will just punt
      to if_indextoname. raj 2008-03-17 */
-  if (link->sdl_index != 0) {
-    cret = if_indextoname(link->sdl_index,buffer);
+  if (socklink->sdl_index != 0) {
+    cret = if_indextoname(socklink->sdl_index,buffer);
     if (NULL != cret)
       return strdup(cret);
     else
       return strdup(strerror(errno));
   }
+  else if (socklink->sdl_nlen > 0) {
+    /* ok, I might have to care after all */
+    strncpy(buffer,socklink->sdl_data,socklink->sdl_nlen);
+    return strdup(buffer);
+  }
   else
     return strdup("noindex");
 }

Modified: trunk/src/netsys_hpux11i.c
===================================================================
--- trunk/src/netsys_hpux11i.c	2008-03-18 21:08:56 UTC (rev 266)
+++ trunk/src/netsys_hpux11i.c	2008-03-18 23:14:47 UTC (rev 267)
@@ -17,7 +17,6 @@
 find_system_info(char **system_model, char **cpu_model, int *cpu_frequency) {
   char model_str[64];
   int  ret;
-  printf("calling find_system_info\n");
   struct pst_processor processor_info;
 
   /* first the system model name */

Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c	2008-03-18 21:08:56 UTC (rev 266)
+++ trunk/src/nettest_omni.c	2008-03-18 23:14:47 UTC (rev 267)
@@ -4439,7 +4439,6 @@
 
     cpu_stop(local_cpu_usage,&elapsed_time);
     
-    printf("calling find_system_info\n");
     find_system_info(&local_system_model,
 		     &local_cpu_model,
 		     &local_cpu_frequency);



More information about the netperf-dev mailing list