[Sumover-tech] New release to support TCL/TK 8.4? (fwd)

Pekka Savola pekkas at netcore.fi
Wed Feb 14 12:26:40 GMT 2007


For public archive and in case no one reads the vic at cs.ucl.ack.uk list 
anymore...

---------- Forwarded message ----------
Date: Thu, 8 Feb 2007 15:17:42 +0200 (EET)
From: Pekka Savola <pekkas at netcore.fi>
To: vic at cs.ucl.ac.uk
Subject: New release to support TCL/TK 8.4?

Hello,

I'm trying to get VIC to build on RHEL4 which includes TCL/TK 8.4.

VIC has a lot of compilation problems.  Patches similar to those applied in the 
FreeBSD ports tree to make it build with TCL/TK 8.4 might apply unless the code 
was littered with ' //SV-XXX: FreeBSD' comments.

However, I note from sumover-dev that some compilation patches have gone in to 
the SVN repository.

Would it be possible to release (ASAP :-) a new version to support TCL/TK 8.4 
and/or create a patch against the stable release(s)?

(FWIW, the attached 3 patches from 5 years ago still seem to be more or less 
applicable to the latest release as well..)

-- 
Pekka Savola                 "You each name yourselves king, yet the
Netcore Oy                    kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings
-------------- next part --------------
--- vic-2.8ucl-1.1.3/vic/net/net-ipv6.cpp	Thu Sep  9 12:48:55 1999
+++ vic-2.8ucl-1.1.3.new/vic/net/net-ipv6.cpp	Fri Jun  8 20:19:36 2001
@@ -277,7 +277,7 @@
   p->sin6_family = AF_INET6;
   int len = sizeof(*p), result = 0;
 
-  if ((result = getsockname(ssock_, (struct sockaddr *)p, &len)) < 0) {
+  if ((result = getsockname(ssock_, (struct sockaddr *)p, (socklen_t *)&len)) < 0) {
     perror("getsockname");
     p->sin6_addr = in6addr_any;
     p->sin6_port = 0;
@@ -522,7 +522,7 @@
 	sockaddr_in6 sfrom;
 	int fromlen = sizeof(sfrom);
 	int cc = ::recvfrom(fd, (char*)buf, len, 0,
-			    (sockaddr*)&sfrom, &fromlen);
+			    (sockaddr*)&sfrom, (socklen_t *)&fromlen);
 	if (cc < 0) {
 		if (errno != EWOULDBLOCK)
 			perror("recvfrom");
-------------- next part --------------
--- vic/net/inet6.h.org	Mon Feb  4 17:51:39 2002
+++ vic/net/inet6.h	Mon Feb  4 17:52:02 2002
@@ -44,7 +44,6 @@
 #define vic_inet6_h
 
 #ifdef HAVE_IPV6
-
 #include <sys/types.h>
 #ifdef WIN32
 //#include <winsock.h>
@@ -62,10 +61,23 @@
 }
 #else
 #include <netinet/in.h>
+#include <netinet6/in6.h>
 #endif
 #endif
 #ifndef WIN32
 #include <arpa/inet.h>
+#ifdef  _NETINET6_IN6_H_
+#ifndef IPV6_ADD_MEMBERSHIP
+#ifdef  IPV6_JOIN_GROUP
+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#endif  /* IPV6_JOIN_GROUP      */
+#endif  /* IPV6_ADD_MEMBERSHIP  */
+#ifndef IPV6_DROP_MEMBERSHIP
+#ifdef  IPV6_LEAVE_GROUP
+#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#endif  /* IPV6_LEAVE_GROUP     */
+#endif  /* IPV6_DROP_MEMBERSHIP */
+#endif  /* _NETINET6_IN6_H_     */
 #endif
 
 #include "config.h"
-------------- next part --------------
Binary files common/src.orig/libuclmmbase.a and common/src/libuclmmbase.a differ
diff -urN common/src.orig/mbus.c common/src/mbus.c
--- common/src.orig/mbus.c	Mon Sep  3 20:53:24 2001
+++ common/src/mbus.c	Wed Dec 18 19:44:56 2002
@@ -459,13 +459,27 @@
 
 	m->cfg = mbus_create_config();
 	mbus_lock_config_file(m->cfg);
-	net_addr = (char *) xmalloc(20);
+	net_addr = (char *) xmalloc(50);
 	mbus_get_net_addr(m->cfg, net_addr, &net_port, &net_scope);
 	m->s		  = udp_init(net_addr, net_port, net_port, net_scope);
         if (m->s == NULL) {
-                debug_msg("Unable to initialize mbus address\n");
-                xfree(m);
-                return NULL;
+                debug_msg("Unable to initialize mbus address: %s\n", net_addr);
+
+		/* 
+		 * possible reason could also be that it's being 
+	         * run on v6-only system, so try falling back..
+		 */
+		if (net_scope == SCOPE_LINKLOCAL)
+			net_addr = xstrdup(MBUS_DEFAULT_V6_NET_ADDR_LINKLOCAL);
+		else
+			net_addr = xstrdup(MBUS_DEFAULT_V6_NET_ADDR_HOSTLOCAL);
+
+		m->s = udp_init(net_addr, net_port, net_port, net_scope);
+
+		if (m->s == NULL) {
+	                xfree(m);
+        	        return NULL;
+		}
         }
 	m->seqnum         = 0;
 	m->cmd_handler    = cmd_handler;
Binary files common/src.orig/mbus.o and common/src/mbus.o differ
diff -urN common/src.orig/mbus_config.c common/src/mbus_config.c
--- common/src.orig/mbus_config.c	Tue Jan  9 18:08:02 2001
+++ common/src/mbus_config.c	Wed Dec 18 19:29:26 2002
@@ -588,8 +588,8 @@
 
 	assert(m->cfg_locked);
 
-	addr = (char *)xmalloc(20);
-	memset(addr, 0, 20);
+	addr = (char *)xmalloc(50);
+	memset(addr, 0, 50);
 	port = 0;
 	scope = -1;
 	
@@ -642,7 +642,7 @@
 		}
 		if (strncmp(line, "ADDRESS", strlen("ADDRESS")) == 0) {
 		    pos2 = strlen("ADDRESS") + 1;
-		    strncpy(addr, line+pos2, 16);
+		    strncpy(addr, line+pos2, 46);
 		}
 		if (strncmp(line, "PORT", strlen("PORT")) == 0) {
 		    pos2 = strlen("PORT") + 1;
@@ -654,7 +654,7 @@
 	*net_port  = (port>0)?port:MBUS_DEFAULT_NET_PORT;
 	*net_scope = (scope!=-1)?scope:MBUS_DEFAULT_SCOPE;
 	if (strlen(addr)>0) {
-		strncpy(net_addr, addr, 16);
+		strncpy(net_addr, addr, 46);
 	} else {
 		strcpy(net_addr, MBUS_DEFAULT_NET_ADDR);
 	}
diff -urN common/src.orig/mbus_config.h common/src/mbus_config.h
--- common/src.orig/mbus_config.h	Tue Jan  4 15:27:58 2000
+++ common/src/mbus_config.h	Wed Dec 18 19:36:59 2002
@@ -52,6 +52,8 @@
 #define SCOPE_LINKLOCAL_NAME 	"LINKLOCAL"
 
 #define MBUS_DEFAULT_NET_ADDR 	"224.255.222.239"
+#define MBUS_DEFAULT_V6_NET_ADDR_HOSTLOCAL 	"ff01::300"
+#define MBUS_DEFAULT_V6_NET_ADDR_LINKLOCAL 	"ff02::300"
 #define MBUS_DEFAULT_NET_PORT 	 47000
 #define MBUS_DEFAULT_SCOPE    	 SCOPE_HOSTLOCAL
 #define MBUS_DEFAULT_SCOPE_NAME	 SCOPE_HOSTLOCAL_NAME
Binary files common/src.orig/mbus_config.o and common/src/mbus_config.o differ


More information about the Sumover-tech mailing list