[Openvas-commits] r6109 - in trunk/openvas-libraries: . misc

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Dec 9 10:16:17 CET 2009


Author: chandra
Date: 2009-12-09 10:16:14 +0100 (Wed, 09 Dec 2009)
New Revision: 6109

Modified:
   trunk/openvas-libraries/ChangeLog
   trunk/openvas-libraries/misc/ids_send.c
   trunk/openvas-libraries/misc/openvas_server.c
   trunk/openvas-libraries/misc/plugutils.c
   trunk/openvas-libraries/misc/www_funcs.c
Log:
Resolved compiler warnings

Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog	2009-12-09 09:00:56 UTC (rev 6108)
+++ trunk/openvas-libraries/ChangeLog	2009-12-09 09:16:14 UTC (rev 6109)
@@ -1,3 +1,14 @@
+2009-12-09  Chandrashekhar B <bchandra at secpod.com>
+
+	* misc/plugutils.c (mark_post): resolved compiler wanring
+
+	* misc/openvas_server.c (openvas_server_open, openvas_server_connect,
+	openvas_server_attach): resolved compiler warnings.
+
+	* misc/www_funcs.c (build_encode_URL): Enable IPv6.
+
+	* misc/ids_send.c (ids_open_sock_tcp): resolved compiler warning.
+
 2009-12-09  Felix Wolfsteller <felix.wolfsteller at intevation.de>
 
 	* misc/plugutils.c: Added TODOs, lead to by compiler warnings of

Modified: trunk/openvas-libraries/misc/ids_send.c
===================================================================
--- trunk/openvas-libraries/misc/ids_send.c	2009-12-09 09:00:56 UTC (rev 6108)
+++ trunk/openvas-libraries/misc/ids_send.c	2009-12-09 09:16:14 UTC (rev 6109)
@@ -669,6 +669,7 @@
  else
  {
    family = AF_INET6;
+   bzero(src6, sizeof(*src6));
    iface = v6_routethrough(dst6, src6);
    src_host = estrdup(inet_ntop(AF_INET6,src6, hostname, sizeof(hostname)));
    dst_host = estrdup(inet_ntop(AF_INET6,dst6, hostname,sizeof(hostname)));

Modified: trunk/openvas-libraries/misc/openvas_server.c
===================================================================
--- trunk/openvas-libraries/misc/openvas_server.c	2009-12-09 09:00:56 UTC (rev 6108)
+++ trunk/openvas-libraries/misc/openvas_server.c	2009-12-09 09:16:14 UTC (rev 6109)
@@ -215,7 +215,7 @@
   /* Complete setup of server session. */
 
   gnutls_transport_set_ptr (*session,
-                            (gnutls_transport_ptr_t) server_socket);
+                            (gnutls_transport_ptr_t) GSIZE_TO_POINTER(server_socket));
 
   new_action.sa_flags = 0;
   if (sigemptyset (&new_action.sa_mask))
@@ -344,7 +344,7 @@
   /* Complete setup of server session. */
 
   gnutls_transport_set_ptr (*server_session,
-                            (gnutls_transport_ptr_t) server_socket);
+                            (gnutls_transport_ptr_t) GSIZE_TO_POINTER(server_socket));
 
   new_action.sa_flags = 0;
   if (sigemptyset (&new_action.sa_mask))
@@ -389,7 +389,7 @@
   struct sigaction new_action, original_action;
 
   gnutls_transport_set_ptr (*session,
-                            (gnutls_transport_ptr_t) socket);
+                            (gnutls_transport_ptr_t) GSIZE_TO_POINTER(socket));
 
   new_action.sa_flags = 0;
   if (sigemptyset (&new_action.sa_mask))

Modified: trunk/openvas-libraries/misc/plugutils.c
===================================================================
--- trunk/openvas-libraries/misc/plugutils.c	2009-12-09 09:00:56 UTC (rev 6108)
+++ trunk/openvas-libraries/misc/plugutils.c	2009-12-09 09:16:14 UTC (rev 6109)
@@ -832,15 +832,16 @@
 }
 
 static void
-mark_post (struct arglist * desc, const char* action, char* content)
+mark_post (struct arglist * desc, const char* action, const char* content)
 {
  char entry_name[255];
+ char *ccontent = estrdup(content);
 
  if(strlen(action) > (sizeof(entry_name) - 20))
   return;
 
  snprintf (entry_name, sizeof(entry_name), "SentData/%s/%s", plug_get_oid(desc), action); /* RATS: ignore */
- plug_set_key (desc, entry_name, ARG_STRING, content);
+ plug_set_key (desc, entry_name, ARG_STRING, ccontent);
 }
 
 

Modified: trunk/openvas-libraries/misc/www_funcs.c
===================================================================
--- trunk/openvas-libraries/misc/www_funcs.c	2009-12-09 09:00:56 UTC (rev 6108)
+++ trunk/openvas-libraries/misc/www_funcs.c	2009-12-09 09:16:14 UTC (rev 6109)
@@ -407,10 +407,19 @@
 	  }
 	else if (strcmp(abs_URI_host, "host IP") == 0)
 	  {
-	    struct in_addr * ptr;
+	    struct in6_addr * ptr;
+            char *asc;
+            char hostname[255];
+
 	    if ((ptr = plug_get_host_ip(data)) != NULL)
 	    {
-	      char * asc = inet_ntoa(*ptr);
+              if(IN6_IS_ADDR_V4MAPPED(ptr))
+              {
+                asc = estrdup(inet_ntop(AF_INET, (struct in_addr *)ptr->s6_addr32[3], hostname, sizeof(hostname)));
+              }
+              else
+                asc = estrdup(inet_ntop(AF_INET6, &ptr, hostname, sizeof(hostname)));
+
 	      strncpy(h, asc, sizeof(h));
 	    }
 	    h[sizeof(h)-1] = '\0';



More information about the Openvas-commits mailing list