Attachment 'pvm3-3.4.4-v6-23042005.diff'

Download

   1 diff -ruN pvm3.old/console/cmds.c pvm3/console/cmds.c
   2 --- pvm3.old/console/cmds.c	2001-09-27 01:37:22.000000000 +0200
   3 +++ pvm3/console/cmds.c	2005-04-19 19:09:26.000000000 +0200
   4 @@ -433,7 +433,7 @@
   5  	int hd_dsig;				/* data signature */
   6  	int hd_err;					/* error code */
   7  	int hd_mtu;					/* max snd/rcv length */
   8 -	/* struct sockaddr_in hd_sad;	/^ UDP address/port */
   9 +	/* struct SOCKADDR_IN hd_sad;	/^ UDP address/port */
  10  	int hd_rxseq;				/* expected next seq num from host */
  11  	int hd_txseq;				/* next tx seq num to host */
  12  	/* struct pkt *hd_txq;		/^ not-yet-sent packet queue to host */
  13 diff -ruN pvm3.old/hoster/pvmwinrexec.c pvm3/hoster/pvmwinrexec.c
  14 --- pvm3.old/hoster/pvmwinrexec.c	1998-11-20 20:47:48.000000000 +0100
  15 +++ pvm3/hoster/pvmwinrexec.c	2005-04-19 19:09:26.000000000 +0200
  16 @@ -312,7 +312,7 @@
  17  {
  18  	WSADATA wsadata;
  19  
  20 -	struct sockaddr_in server_addr, my_err_addr, junk_addr;
  21 +	struct SOCKADDR_IN server_addr, my_err_addr, junk_addr;
  22  	struct servent *sv;
  23  	struct hostent *hent;
  24  	static char portbuf[30];
  25 @@ -335,7 +335,7 @@
  26  		return(0);
  27  	}
  28  
  29 -	hent = gethostbyname(remote_host);
  30 +	hent = GETHOSTBYNAME(remote_host);
  31  	if(!hent) {
  32  		fprintf(stderr, "Lookup of server hostname failed: error=%d.\n",
  33  			WSAGetLastError());
  34 @@ -367,7 +367,7 @@
  35  
  36  	memset(&my_err_addr, '\0', sizeof my_err_addr);
  37  	my_err_addr.sin_addr.s_addr = htonl(INADDR_ANY);
  38 -	my_err_addr.sin_family = AF_INET;
  39 +	my_err_addr.sin_family = AF_FAMILY;
  40  	my_err_addr.sin_port = 0;
  41  
  42  	if ((sTmp=socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
  43 diff -ruN pvm3.old/hoster/pvmwinrsh.c pvm3/hoster/pvmwinrsh.c
  44 --- pvm3.old/hoster/pvmwinrsh.c	1999-03-15 22:52:03.000000000 +0100
  45 +++ pvm3/hoster/pvmwinrsh.c	2005-04-19 19:09:26.000000000 +0200
  46 @@ -33,8 +33,8 @@
  47  #include <pvmwin.h>
  48  #include <winsock.h>
  49  
  50 -struct sockaddr_in anaddr; // local socket address structure 
  51 -struct sockaddr_in saddr; // server socket address structure
  52 +struct SOCKADDR_IN anaddr; // local socket address structure 
  53 +struct SOCKADDR_IN saddr; // server socket address structure
  54  
  55  u_short rshPort; // the local rsh port; determined dynamically
  56  u_short rshErrPort; // the local rsh port for client stderr output
  57 @@ -61,12 +61,12 @@
  58  int
  59  rresvport (u_short *alport, int sProto)
  60  {
  61 -    struct sockaddr_in sin;
  62 +    struct SOCKADDR_IN sin;
  63      int s;
  64  
  65 -    sin.sin_family=AF_INET;
  66 +    sin.sin_family=AF_FAMILY;
  67      sin.sin_addr.s_addr=INADDR_ANY;
  68 -    s=socket(AF_INET, SOCK_STREAM, sProto);
  69 +    s=socket(PF_FAMILY, SOCK_STREAM, sProto);
  70      if(s<0)
  71          return -1;
  72  
  73 @@ -139,7 +139,7 @@
  74  	if(saddr.sin_addr.s_addr==(u_long)INADDR_NONE)
  75  	{
  76  		// must have gotten host name instead of IP address; resolve!
  77 -		struct hostent* hostInfo=gethostbyname(hostname);
  78 +		struct hostent* hostInfo=GETHOSTBYNAME(hostname);
  79  		if(!hostInfo) {
  80  			fprintf(stdout,"Invalid hostname!");
  81  			return 0;
  82 @@ -285,7 +285,7 @@
  83      initSocket();
  84      if(!initErrSocket())
  85  	fprintf(stdout,"Cannot create error socket!");
  86 -	saddr.sin_family=AF_INET;
  87 +	saddr.sin_family=AF_FAMILY;
  88  	saddr.sin_port=rshSPort;
  89  	if(connect(rshClient, (struct sockaddr FAR*)&saddr, sizeof(saddr)))
  90  	     fprintf(stdout,"Cannot connect to RSH port!\n");
  91 diff -ruN pvm3.old/src/AIX4SP2/pvmdmimd.c pvm3/src/AIX4SP2/pvmdmimd.c
  92 --- pvm3.old/src/AIX4SP2/pvmdmimd.c	2001-09-25 23:19:00.000000000 +0200
  93 +++ pvm3/src/AIX4SP2/pvmdmimd.c	2005-04-19 19:09:26.000000000 +0200
  94 @@ -838,13 +838,13 @@
  95  mksock()
  96  {	
  97  	struct hostd *hp = hosts->ht_hosts[hosts->ht_local];
  98 -	struct sockaddr_in sin;
  99 +	struct SOCKADDR_IN sin;
 100  	char buf[128];
 101  	char *p;
 102  	int cc;
 103  	int sock;
 104  
 105 -	if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
 106 +	if ((sock = socket(PF_FAMILY, SOCK_STREAM, 0)) == -1) {
 107  		pvmlogperror("mksock() socket");
 108  		return -1;
 109  	}
 110 diff -ruN pvm3.old/src/BEOLIN/pvmdmimd.c pvm3/src/BEOLIN/pvmdmimd.c
 111 --- pvm3.old/src/BEOLIN/pvmdmimd.c	2000-02-17 22:02:24.000000000 +0100
 112 +++ pvm3/src/BEOLIN/pvmdmimd.c	2005-04-19 19:09:26.000000000 +0200
 113 @@ -160,7 +160,7 @@
 114  	struct hostent *hostaddr;
 115  	int 	i;
 116  	int		n;
 117 -	struct in_addr	node_sin_addr;
 118 +	struct IN_ADDR	node_sin_addr;
 119  	char 	nname[128];	/* node name */
 120  	char 	*p, *q;
 121  	char 	*plist;		/* processor list */
 122 @@ -195,16 +195,16 @@
 123  			n = (q = CINDEX(p, ':')) ? q - p : strlen(p);
 124  			strncpy(nname, p, n);
 125  			nname[n] = 0;
 126 -			if (!(hostaddr = gethostbyname( nname )))
 127 +			if (!(hostaddr = GETHOSTBYNAME( nname )))
 128  				{
 129 -				sprintf( pvmtxt, "mpp_init() can't gethostbyname() for %s\n", 
 130 +				sprintf( pvmtxt, "mpp_init() can't GETHOSTBYNAME() for %s\n", 
 131  						nname );
 132  				pvmlogerror( pvmtxt );
 133  				}
 134  			else
 135  				{	/* got addr, now save it */
 136  				BCOPY( hostaddr->h_addr_list[0], (char*)&node_sin_addr,
 137 -					sizeof(struct in_addr));
 138 +					sizeof(struct IN_ADDR));
 139  				}
 140  			nodeaddr[i] = node_sin_addr.s_addr;
 141  			nodelist[i++] = STRALLOC(nname);
 142 diff -ruN pvm3.old/src/ddpro.c pvm3/src/ddpro.c
 143 --- pvm3.old/src/ddpro.c	2001-09-27 01:35:19.000000000 +0200
 144 +++ pvm3/src/ddpro.c	2005-04-22 19:38:20.059222888 +0200
 145 @@ -416,11 +416,13 @@
 146  #include "msgbox.h"
 147  #include "global.h"
 148  
 149 +#include "pvmipv6.h"
 150 +
 151  
 152  void pvmbailout();
 153  char *inadport_hex();
 154  char *getenv();
 155 -void hex_inadport __ProtoGlarp__ (( char *, struct sockaddr_in * ));
 156 +void hex_inadport __ProtoGlarp__ (( char *, struct SOCKADDR_IN * ));
 157  void mesg_rewind __ProtoGlarp__ (( struct pmsg * ));
 158  void tev_send_newtask();
 159  
 160 @@ -903,7 +905,7 @@
 161  
 162  	hp = hosts->ht_hosts[hosts->ht_local];
 163  
 164 -	if ( hp->hd_sad.sin_addr.s_addr == htonl(0x7f000001) ) {
 165 +	if ( ADDR_IS_LOOPBACK(ADDR_FROM_SA(hp->hd_sad))) {
 166  
 167  		/* damn, we're hosed.  bail on host adds with new */
 168  		/* PvmIPLoopback error code... */
 169 @@ -926,14 +928,14 @@
 170  		if (hp->hd_err)
 171  			continue;
 172  
 173 -		if (he = gethostbyname(hp->hd_aname ? hp->hd_aname : hp->hd_name)) {
 174 -			BCOPY(he->h_addr_list[0], (char*)&hp->hd_sad.sin_addr,
 175 -					sizeof(struct in_addr));
 176 +		if (he = GETHOSTBYNAME(hp->hd_aname ? hp->hd_aname : hp->hd_name)) {
 177 +		    BCOPY(he->h_addr_list[0], (char*)&ADDR_FROM_SA(hp->hd_sad),
 178 +					sizeof(struct IN_ADDR));
 179  
 180  		} else {
 181  			if (pvmdebmask & PDMSTARTUP) {
 182  				pvmlogprintf(
 183 -						"start_slaves() can't gethostbyname: %s\n",
 184 +						"start_slaves() can't GETHOSTBYNAME: %s\n",
 185  						hp->hd_name);
 186  			}
 187  			hp->hd_err = PvmNoHost;
 188 @@ -945,7 +947,7 @@
 189  		if (!(hp->hd_flag & HF_OVERLOAD)) {
 190  			for (hh = hosts->ht_last; hh > 0; hh--)
 191  				if ((hp2 = hosts->ht_hosts[hh])
 192 -				&& (hp2->hd_sad.sin_addr.s_addr == hp->hd_sad.sin_addr.s_addr)) {
 193 +				&& (ADDR_EQUALS(ADDR_FROM_SA(hp2->hd_sad), ADDR_FROM_SA(hp->hd_sad)))) {
 194  					hp->hd_err = PvmDupHost;
 195  					break;
 196  				}
 197 @@ -955,8 +957,7 @@
 198  	/* make sure new ones aren't duplicated */
 199  
 200  			for (j = i; j-- > 0; )
 201 -				if (hp->hd_sad.sin_addr.s_addr
 202 -				== wxp->w_hosts[j]->hd_sad.sin_addr.s_addr) {
 203 +			    if (ADDR_EQUALS(ADDR_FROM_SA(hp->hd_sad),ADDR_FROM_SA(wxp->w_hosts[j]->hd_sad))) {
 204  					hp->hd_err = PvmDupHost;
 205  					break;
 206  				}
 207 @@ -1722,7 +1723,11 @@
 208  {
 209  	int count;			/* number of hosts in message */
 210  	int hh;
 211 +#ifdef INET6
 212 +	char buf[INET6_ADDRSTRLEN+2+20];		/* for converting sockaddr */
 213 +#else
 214  	char buf[16];		/* for converting sockaddr */
 215 +#endif
 216  	struct pmsg *mp2;
 217  
 218  	/* unpack new host table params */
 219 @@ -2039,7 +2044,11 @@
 220  	int count;				/* num of new hosts */
 221  	int happy;				/* num of happy new hosts */
 222  	struct waitc_add *wxp;
 223 +#ifdef INET6
 224 +	char *av[INET6_ADDRSTRLEN+2+20];			/* for reply parsing */
 225 +#else
 226  	char *av[16];			/* for reply parsing */
 227 +#endif
 228  	int ac;
 229  	int ver;
 230  	int i, j;
 231 diff -ruN pvm3.old/src/host.c pvm3/src/host.c
 232 --- pvm3.old/src/host.c	2001-09-27 01:35:18.000000000 +0200
 233 +++ pvm3/src/host.c	2005-04-19 19:09:26.000000000 +0200
 234 @@ -266,7 +266,7 @@
 235  		BZERO((char*)hp, sizeof(struct hostd));
 236  		hp->hd_ref = 1;
 237  		hp->hd_hostpart = hh << (ffs(tidhmask) - 1);
 238 -		hp->hd_sad.sin_family = AF_INET;
 239 +		FAMILY_FROM_SA(hp->hd_sad) = AF_FAMILY;
 240  		hp->hd_txq = pk_new(0);
 241  		hp->hd_opq = pk_new(0);
 242  		hp->hd_rxq = pk_new(0);
 243 @@ -814,7 +814,7 @@
 244  	int err = 0;		/* error count */
 245  	struct hostent *he;
 246  	char *p;
 247 -	struct in_addr *my_in_addrs;
 248 +	struct IN_ADDR *my_in_addrs;
 249  	int num_addrs;
 250  	int i;
 251  	int maxhostid = tidhmask >> (ffs(tidhmask) - 1);
 252 @@ -885,21 +885,21 @@
 253  
 254  	/* look up ip addr */
 255  
 256 -		if (!(he = gethostbyname(hp->hd_aname ? hp->hd_aname : hp->hd_name))) {
 257 -			pvmlogprintf("readhostfile() %s %d: %s: can't gethostbyname\n",
 258 +		if (!(he = GETHOSTBYNAME(hp->hd_aname ? hp->hd_aname : hp->hd_name))) {
 259 +			pvmlogprintf("readhostfile() %s %d: %s: can't GETHOSTBYNAME\n",
 260  				fn, lnum, hp->hd_name);
 261  			err++;
 262  			goto badline;
 263  		}
 264 -		BCOPY(he->h_addr_list[0], (char*)&hp->hd_sad.sin_addr,
 265 -			sizeof(struct in_addr));
 266 +		BCOPY(he->h_addr_list[0], (char*)&ADDR_FROM_SA(hp->hd_sad),
 267 +			sizeof(struct IN_ADDR));
 268  
 269  	/* mark master host to not start */
 270  
 271  		if (!(hp->hd_flag & HF_OVERLOAD))
 272  			for (i = num_addrs; i-- > 0; ) {
 273 -				if (BCMP((char*)&my_in_addrs[i], (char*)&hp->hd_sad.sin_addr,
 274 -						sizeof(struct in_addr)) == 0) {
 275 +			    if (BCMP((char*)&my_in_addrs[i], (char*)&ADDR_FROM_SA(hp->hd_sad),
 276 +						sizeof(struct IN_ADDR)) == 0) {
 277  					hp->hd_flag |= HF_NOSTART;
 278  					break;
 279  				}
 280 @@ -937,16 +937,77 @@
 281  *
 282  *	Return list of addresses for active network interfaces.
 283  */
 284 +#ifdef INET6
 285 +int
 286 +iflist(alp, np)
 287 +	struct IN_ADDR **alp;	/* return list of addresses */
 288 +	int *np;				/* return len of alp */
 289 +{
 290 +	static struct IN_ADDR *iplist = 0;	/* list of interface addrs found */
 291 +	int nip = 0;						/* length of iplist */
 292 +	char **p;
 293 +
 294 +	FILE *f;
 295 +    	char addr6[40], devname[20];
 296 +    	struct SOCKADDR_IN sap;
 297 +    	int plen, scope, dad_status, if_idx;
 298 +    	char addr6p[8][5];  
 299 +
 300 +
 301 +	if (iplist)
 302 +		PVM_FREE(iplist);
 303 +	iplist = TALLOC(10, struct IN_ADDR, "ifl");
 304 +
 305 +#ifdef IMA_LINUX
 306 +#ifndef _PATH_PROCNET_IFINET6	
 307 +#define _PATH_PROCNET_IFINET6	"/proc/net/if_inet6"
 308 +#endif /* _PATH_PROCNET_IFNET6 */
 309 +#else
 310 +#error "Don't know where to look for IPv6 interfaces"
 311 +#endif
 312 +
 313 +    if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
 314 +	while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
 315 +		      addr6p[0], addr6p[1], addr6p[2], addr6p[3],
 316 +		      addr6p[4], addr6p[5], addr6p[6], addr6p[7],
 317 +		  &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
 318 +		sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
 319 +			addr6p[0], addr6p[1], addr6p[2], addr6p[3],
 320 +			addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
 321 +		pvmlogprintf(" Got interface IPv6 %s\n",addr6);
 322 +		inet_pton(AF_INET6, addr6, sap.sin6_addr.s6_addr);
 323 +		if (nip > 0 && !(nip % 10))
 324 +			iplist = TREALLOC(iplist, (nip + 10), struct IN_ADDR);
 325 +		memcpy(&iplist[nip],&sap.sin6_addr,sizeof(struct IN_ADDR));
 326 +		nip++;
 327 +
 328 +	}
 329 +	fclose(f);
 330 +    }
 331 +    else
 332 +    {
 333 +	fprintf(stderr, "can't open %s\n",_PATH_PROCNET_IFINET6);
 334 +	goto bail;
 335 +    }
 336 +
 337 +	*alp = iplist;
 338 +	*np = nip;
 339 +	return 0;
 340 +
 341 +bail:
 342 +	return -1;
 343 +}
 344 +#else
 345  
 346  #ifdef	SIOCGIFCONF
 347  
 348  int
 349  iflist(alp, np)
 350 -	struct in_addr **alp;	/* return list of addresses */
 351 +	struct IN_ADDR **alp;	/* return list of addresses */
 352  	int *np;				/* return len of alp */
 353  {
 354  	int soc = -1;						/* socket */
 355 -	static struct in_addr *iplist = 0;	/* list of interface addrs found */
 356 +	static struct IN_ADDR *iplist = 0;	/* list of interface addrs found */
 357  	int nip = 0;						/* length of iplist */
 358  	char buf[4096];						/* return space for SIOCGIOCONF */
 359  	struct ifconf sif;
 360 @@ -956,9 +1017,9 @@
 361  
 362  	if (iplist)
 363  		PVM_FREE(iplist);
 364 -	iplist = TALLOC(10, struct in_addr, "ifl");
 365 +	iplist = TALLOC(10, struct IN_ADDR, "ifl");
 366  
 367 -	if ((soc = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
 368 +	if ((soc = socket(PF_FAMILY, SOCK_DGRAM, 0)) == -1) {
 369  		perror("socket");
 370  		goto bail;
 371  	}
 372 @@ -985,7 +1046,7 @@
 373  			cp += sizeof(*reqp) - sizeof(struct sockaddr) + SIZ(reqp->ifr_addr))
 374  	{
 375  		reqp = (struct ifreq*)cp;
 376 -		if (reqp->ifr_addr.sa_family != AF_INET)
 377 +		if (reqp->ifr_addr.sa_family != AF_FAMILY)
 378  			continue;
 379  		BCOPY(reqp->ifr_name, req.ifr_name, sizeof(req.ifr_name));
 380  		if (ioctl(soc, SIOCGIFFLAGS, &req) == -1) {
 381 @@ -996,13 +1057,13 @@
 382  		/* if (IFF_UP & req.ifr_flags) { */
 383  		if (IFF_UP & req.ifr_ifru.ifru_flags) {
 384  			if (nip > 0 && !(nip % 10))
 385 -				iplist = TREALLOC(iplist, (nip + 10), struct in_addr);
 386 +				iplist = TREALLOC(iplist, (nip + 10), struct IN_ADDR);
 387  			iplist[nip++] =
 388 -			((struct sockaddr_in*)(&reqp->ifr_ifru.ifru_addr))->sin_addr;
 389 +			((struct SOCKADDR_IN*)(&reqp->ifr_ifru.ifru_addr))->sin_addr;
 390  			if (pvmdebmask & PDMNET) {
 391  				long a;
 392  
 393 -				a = ((struct sockaddr_in*)(&reqp->ifr_ifru.ifru_addr))->sin_addr.s_addr;
 394 +				a = ((struct SOCKADDR_IN*)(&reqp->ifr_ifru.ifru_addr))->sin_addr.s_addr;
 395  				a = ntohl(a);
 396  				pvmlogprintf("iflist() %s %d.%d.%d.%d\n",
 397  						reqp->ifr_name,
 398 @@ -1027,10 +1088,10 @@
 399  
 400  int
 401  iflist(alp, np)
 402 -	struct in_addr **alp;	/* return list of addresses */
 403 +	struct IN_ADDR **alp;	/* return list of addresses */
 404  	int *np;				/* return len of alp */
 405  {
 406 -	static struct in_addr *iplist = 0;	/* list of interface addrs found */
 407 +	static struct IN_ADDR *iplist = 0;	/* list of interface addrs found */
 408  	int nip = 0;						/* length of iplist */
 409  	char hn[MAXHOSTNAMELEN];
 410  	struct hostent *he;
 411 @@ -1038,20 +1099,20 @@
 412  
 413  	if (iplist)
 414  		PVM_FREE(iplist);
 415 -	iplist = TALLOC(10, struct in_addr, "ifl");
 416 +	iplist = TALLOC(10, struct IN_ADDR, "ifl");
 417  
 418  	if (gethostname(hn, sizeof(hn))) {
 419  		perror("gethostname");
 420  		goto bail;
 421  	}
 422 -	if (!(he = gethostbyname(hn))) {
 423 -		fprintf(stderr, "can't gethostbyname\n");
 424 +	if (!(he = GETHOSTBYNAME(hn))) {
 425 +		fprintf(stderr, "can't GETHOSTBYNAME\n");
 426  		goto bail;
 427  	}
 428  	for (; he->h_addr_list[nip]; nip++) {
 429  		if (nip > 0 && !(nip % 10))
 430 -			iplist = TREALLOC(iplist, (nip + 10), struct in_addr);
 431 -		iplist[nip].s_addr = ((struct in_addr*)(he->h_addr_list[nip]))->s_addr;
 432 +			iplist = TREALLOC(iplist, (nip + 10), struct IN_ADDR);
 433 +		iplist[nip].s_addr = ((struct IN_ADDR*)(he->h_addr_list[nip]))->s_addr;
 434  	}
 435  
 436  	*alp = iplist;
 437 @@ -1064,6 +1125,7 @@
 438  
 439  #endif	/*SIOCGIFCONF*/
 440  
 441 +#endif /* INET6 */
 442  
 443  /*	acav()
 444  *
 445 diff -ruN pvm3.old/src/host.h pvm3/src/host.h
 446 --- pvm3.old/src/host.h	2001-09-27 01:35:21.000000000 +0200
 447 +++ pvm3/src/host.h	2005-04-19 19:09:26.000000000 +0200
 448 @@ -71,7 +71,7 @@
 449   *
 450   */
 451  
 452 -
 453 +#include "pvmipv6.h"
 454  /* Host descriptor */
 455  
 456  struct hostd {
 457 @@ -89,7 +89,7 @@
 458  	int hd_dsig;				/* data signature */
 459  	int hd_err;					/* error code */
 460  	int hd_mtu;					/* max snd/rcv length */
 461 -	struct sockaddr_in hd_sad;	/* UDP address/port */
 462 +	struct SOCKADDR_IN hd_sad;	/* UDP address/port */
 463  	int hd_rxseq;				/* expected next seq num from host */
 464  	int hd_txseq;				/* next tx seq num to host */
 465  	struct pkt *hd_txq;			/* not-yet-sent packet queue to host */
 466 diff -ruN pvm3.old/src/lpvm.c pvm3/src/lpvm.c
 467 --- pvm3.old/src/lpvm.c	2001-09-25 23:20:17.000000000 +0200
 468 +++ pvm3/src/lpvm.c	2005-04-22 19:32:28.288700136 +0200
 469 @@ -633,7 +633,7 @@
 470   ***************/
 471  
 472  char *getenv();
 473 -void hex_inadport __ProtoGlarp__ (( char *, struct sockaddr_in * ));
 474 +void hex_inadport __ProtoGlarp__ (( char *, struct SOCKADDR_IN * ));
 475  
 476  extern char *inadport_decimal();
 477  extern char *inadport_hex();
 478 @@ -660,7 +660,7 @@
 479   ***************/
 480  
 481  static int mxfersingle = 1;				/* mxfer returns after single frag */
 482 -static struct sockaddr_in pvmourinet;	/* our host ip addr */
 483 +static struct SOCKADDR_IN pvmourinet;	/* our host ip addr */
 484  static struct ttpcb *ttlist = 0;		/* dll of connected tasks */
 485  static struct ttpcb *topvmd = 0;		/* default route (to pvmd) */
 486  static int pvmnfds = 0;					/* 1 + highest bit set in fds */
 487 @@ -1229,7 +1229,7 @@
 488  #endif /*NOUNIXDOM*/
 489  
 490  			} else {
 491 -				if ((pcbp->tt_fd = socket(AF_INET, SOCK_STREAM, 0))
 492 +				if ((pcbp->tt_fd = socket(PF_FAMILY, SOCK_STREAM, 0))
 493  						== -1) {
 494  					pvmlogperror("pvm_tc_conreq() socket");
 495  
 496 @@ -1390,7 +1390,7 @@
 497  #endif /*NOUNIXDOM*/
 498  
 499  					} else {
 500 -						pcbp->tt_osad.sin_family = AF_INET;
 501 +						FAMILY_FROM_SA(pcbp->tt_osad) = AF_FAMILY;
 502  						hex_inadport(buf, &pcbp->tt_osad);
 503  						while ((i = connect(pcbp->tt_fd,
 504  								(struct sockaddr*)&pcbp->tt_osad,
 505 @@ -1765,7 +1765,7 @@
 506  #endif
 507  	char *txcp = 0;				/* point to remainder of txfp */
 508  	int txtogo = 0;				/* len of remainder of txfp */
 509 -	struct sockaddr_in sad;
 510 +	struct SOCKADDR_IN sad;
 511  	int s;
 512  	struct ttpcb *pcbp;
 513  	char *inPlaceHeader = (char  *) NULL;	/* for inplace data */
 514 @@ -2318,7 +2318,7 @@
 515  	int s;						/* socket */
 516  	int sbf;					/* temp TC_CONREQ message */
 517  	struct pmsg *up, *up2;
 518 -	struct sockaddr_in sad;
 519 +	struct SOCKADDR_IN sad;
 520  	int l;
 521  #ifdef SOCKLENISUINT
 522  #ifdef IMA_AIX4SP2
 523 @@ -2426,7 +2426,7 @@
 524  #endif /* !NOUNIXDOM */
 525  			/* Open a TCP direct Connection here, instead */
 526  
 527 -				if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
 528 +				if ((s = socket(PF_FAMILY, SOCK_STREAM, 0)) == -1) {
 529  					pvmlogperror("mroute() socket");
 530  
 531  				} else {
 532 @@ -2852,7 +2852,7 @@
 533  #endif /*NOUNIXDOM*/
 534  
 535  	} else {
 536 -		if ((topvmd->tt_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
 537 +		if ((topvmd->tt_fd = socket(PF_FAMILY, SOCK_STREAM, 0)) == -1) {
 538  			pvmlogperror("mksocs() socket");
 539  			goto bail;
 540  		}
 541 @@ -2860,7 +2860,7 @@
 542  		try = 5;
 543  		while (1) {	/* goto is at the root of all good programming style */
 544  			hex_inadport(p, &topvmd->tt_osad);
 545 -			topvmd->tt_osad.sin_family = AF_INET;
 546 +			FAMILY_FROM_SA(topvmd->tt_osad) = AF_FAMILY;
 547  			n = sizeof(topvmd->tt_osad);
 548  
 549  			if (connect(topvmd->tt_fd, (struct sockaddr*)&topvmd->tt_osad, n)
 550 @@ -2948,7 +2948,11 @@
 551  	char authfn[PVMTMPNAMLEN];	/* auth file name */
 552  	int authfd = -1;				/* auth fd to validate pvmd ident */
 553  	int i;
 554 +#ifdef INET6
 555 +	char buf[INET6_ADDRSTRLEN+2+20];					/* for converting sockaddr */
 556 +#else
 557  	char buf[16];					/* for converting sockaddr */
 558 +#endif
 559  	char *p;
 560  	struct pvmminfo minfo;
 561  	int outtid, outctx, outtag;
 562 @@ -3249,23 +3253,23 @@
 563  		hex_inadport(buf, &pvmourinet);
 564  	} else {
 565  		/* got name, now get addr */
 566 -		if (!(hostaddr = gethostbyname( namebuf ))) {
 567 -			pvmlogprintf( "pvmbeatask() can't gethostbyname() for %s\n",
 568 +		if (!(hostaddr = GETHOSTBYNAME( namebuf ))) {
 569 +			pvmlogprintf( "pvmbeatask() can't GETHOSTBYNAME() for %s\n",
 570  					namebuf );
 571  			hex_inadport(buf, &pvmourinet);
 572  		} else {
 573  			/* got addr, now save it */
 574  			BCOPY( hostaddr->h_addr_list[0],
 575  					(char*)&pvmourinet.sin_addr,
 576 -					sizeof(struct in_addr));
 577 +					sizeof(struct IN_ADDR));
 578  		}
 579  	}
 580  #else
 581  	hex_inadport(buf, &pvmourinet);
 582  #endif
 583  
 584 -	pvmourinet.sin_family = AF_INET;
 585 -	pvmourinet.sin_port = 0;
 586 +	FAMILY_FROM_SA(pvmourinet) = AF_FAMILY;
 587 +	PORT_FROM_SA(pvmourinet) = 0;
 588  
 589  	pvm_upkint(&pvmschedtid, 1, 1);
 590  #endif
 591 diff -ruN pvm3.old/src/lpvm.h pvm3/src/lpvm.h
 592 --- pvm3.old/src/lpvm.h	2000-02-16 23:00:59.000000000 +0100
 593 +++ pvm3/src/lpvm.h	2005-04-19 19:09:26.000000000 +0200
 594 @@ -107,6 +107,8 @@
 595  #endif
 596  extern	int pvmautoerr;				/* whether to auto print err msgs */
 597  
 598 +#include "pvmipv6.h"
 599 +
 600  extern	struct Pvmtracer pvmctrc;	/* child tracer info */
 601  extern	struct Pvmtracer pvmtrc;	/* task tracer info */
 602  
 603 @@ -190,8 +192,8 @@
 604  	int tt_tid;                     /* tid of peer or 0 if master of list */
 605  	int tt_state;
 606  	int tt_fd;                      /* fd of connection or -1 */
 607 -	struct sockaddr_in tt_sad;      /* address of our socket */
 608 -	struct sockaddr_in tt_osad;     /* (authd) address of peer socket */
 609 +	struct SOCKADDR_IN tt_sad;      /* address of our socket */
 610 +	struct SOCKADDR_IN tt_osad;     /* (authd) address of peer socket */
 611  	struct pmsg *tt_rxfrag;         /* not-assembled incm msg */
 612  	struct frag *tt_rxf;            /* partial incm frag */
 613  #ifndef NOUNIXDOM
 614 diff -ruN pvm3.old/src/lpvmmimd.c pvm3/src/lpvmmimd.c
 615 --- pvm3.old/src/lpvmmimd.c	2001-05-11 19:32:28.000000000 +0200
 616 +++ pvm3/src/lpvmmimd.c	2005-04-19 19:09:26.000000000 +0200
 617 @@ -287,7 +287,7 @@
 618  #endif
 619  
 620  char *getenv();
 621 -void hex_inadport __ProtoGlarp__ (( char *, struct sockaddr_in * ));
 622 +void hex_inadport __ProtoGlarp__ (( char *, struct SOCKADDR_IN * ));
 623  
 624  extern struct encvec *enctovec();
 625  
 626 @@ -1216,7 +1216,7 @@
 627  {
 628  	char *p;
 629  	int dsock;					/* pvmd socket */
 630 -	struct sockaddr_in dsadr;	/* address of pvmd socket */
 631 +	struct SOCKADDR_IN dsadr;	/* address of pvmd socket */
 632  	int n;
 633  	int pvminfo[SIZEHINFO];		/* ntask, hostpart, ptid, MTU, NDF */
 634  	char nullmsg[TDFRAGHDR+TTMSGHDR];
 635 @@ -1227,14 +1227,14 @@
 636  		exit(2);
 637  	}
 638  	mpierrcode = 0;
 639 -	if ((dsock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
 640 +	if ((dsock = socket(PF_FAMILY, SOCK_STREAM, 0)) == -1) {
 641  		pvmlogperror("pvmhost() socket");
 642  		MPI_Finalize();
 643  		exit(3);
 644  	}
 645  	BZERO((char*)&dsadr, sizeof(dsadr));
 646  	hex_inadport(p, &dsadr);
 647 -	dsadr.sin_family = AF_INET;
 648 +	dsadr.sin_family = AF_FAMILY;
 649  	n = sizeof(dsadr);
 650  	while (connect(dsock, (struct sockaddr*)&dsadr, n) == -1)
 651  		if (errno != EINTR) {
 652 diff -ruN pvm3.old/src/lpvmshmem.c pvm3/src/lpvmshmem.c
 653 --- pvm3.old/src/lpvmshmem.c	2001-09-25 23:21:00.000000000 +0200
 654 +++ pvm3/src/lpvmshmem.c	2005-04-19 19:09:26.000000000 +0200
 655 @@ -493,7 +493,7 @@
 656  
 657  char *getenv();
 658  
 659 -void hex_inadport __ProtoGlarp__ (( char *, struct sockaddr_in * ));
 660 +void hex_inadport __ProtoGlarp__ (( char *, struct SOCKADDR_IN * ));
 661  
 662  /* These prototypes stop compiler casting structs to ints... */
 663  struct pmsg *midtobuf(); /* Oops someone forgot this one KEV/GEF */
 664 @@ -574,7 +574,7 @@
 665  static int pvminboxsz = 0;				/* size of incoming message buffer */
 666  static int mypidtid = -1;				/* my position in pid-tid table */
 667  static int pvmdpid = 0;					/* pvmd's Unix proc ID */
 668 -static struct sockaddr_in pvmdsad;		/* address of pvmd socket */
 669 +static struct SOCKADDR_IN pvmdsad;		/* address of pvmd socket */
 670  static int pvmdsock = -1;				/* pvmd socket descriptor */
 671  
 672  static void (*pvmoldtermhdlr)() = 0;
 673 @@ -628,7 +628,7 @@
 674  	}
 675  
 676  	hex_inadport(p, &pvmdsad);
 677 -	pvmdsad.sin_family = AF_INET;
 678 +	pvmdsad.sin_family = AF_FAMILY;
 679  }
 680  
 681  
 682 @@ -644,7 +644,7 @@
 683  	static char dummy[TDFRAGHDR];
 684  
 685  	if (pvmdsock == -1) {
 686 -		if ((pvmdsock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
 687 +		if ((pvmdsock = socket(PF_FAMILY, SOCK_STREAM, 0)) == -1) {
 688  			pvmlogperror("prodpvmd() socket");
 689  			return;
 690  		}
 691 @@ -2688,7 +2688,7 @@
 692  
 693  	char *txcp = 0;				/* point to remainder of txfp */
 694  	int txtogo = 0;				/* len of remainder of txfp */
 695 -	struct sockaddr_in sad;
 696 +	struct SOCKADDR_IN sad;
 697  	int s;
 698  	struct msgid *sendmsg = (struct msgid *) NULL;
 699  	char errtxt[64];
 700 diff -ruN pvm3.old/src/mppmsg.c pvm3/src/mppmsg.c
 701 --- pvm3.old/src/mppmsg.c	2000-02-17 00:30:02.000000000 +0100
 702 +++ pvm3/src/mppmsg.c	2005-04-19 19:09:26.000000000 +0200
 703 @@ -63,7 +63,7 @@
 704  
 705  /* --- external declarations */
 706  
 707 -void hex_inadport __ProtoGlarp__ (( char *, struct sockaddr_in * ));
 708 +void hex_inadport __ProtoGlarp__ (( char *, struct SOCKADDR_IN * ));
 709  
 710  extern int errno;
 711  extern int pvmdebmask;           /* from pvmd.c */
 712 @@ -829,7 +829,7 @@
 713  {
 714  	char *p;
 715  	int dsock;					/* pvmd socket */
 716 -	struct sockaddr_in dsadr;	/* address of pvmd socket */
 717 +	struct SOCKADDR_IN dsadr;	/* address of pvmd socket */
 718  	int n;
 719  	int i;
 720  	int cc;
 721 @@ -850,14 +850,14 @@
 722  		pvm_mpp_message_stop();
 723  		exit(2);
 724  	}
 725 -	if ((dsock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
 726 +	if ((dsock = socket(PF_FAMILY, SOCK_STREAM, 0)) == -1) {
 727  		pvmlogperror("pvmhost() socket");
 728  		pvm_mpp_message_stop();
 729  		exit(3);
 730  	}
 731  	BZERO((char*)&dsadr, sizeof(dsadr));
 732  	hex_inadport(p, &dsadr);
 733 -	dsadr.sin_family = AF_INET;
 734 +	dsadr.sin_family = AF_FAMILY;
 735  	n = sizeof(dsadr);
 736  	while (connect(dsock, (struct sockaddr*)&dsadr, n) == -1)
 737  		if (errno != EINTR) {
 738 diff -ruN pvm3.old/src/OS2/src/rexec.c pvm3/src/OS2/src/rexec.c
 739 --- pvm3.old/src/OS2/src/rexec.c	1997-08-28 23:30:49.000000000 +0200
 740 +++ pvm3/src/OS2/src/rexec.c	2005-04-19 19:09:26.000000000 +0200
 741 @@ -55,12 +55,12 @@
 742  	int *fd2p;
 743  {
 744  	int s, timo = 1, s3;
 745 -	struct sockaddr_in sin, sin2, from;
 746 +	struct SOCKADDR_IN sin, sin2, from;
 747  	char c;
 748  	u_short port;
 749  	struct hostent *hp;
 750  	static char savename[256];
 751 -	hp = gethostbyname(*ahost);
 752 +	hp = GETHOSTBYNAME(*ahost);
 753  	if (hp == 0) {
 754  		fprintf(stderr, "%s: unknown host\n", *ahost);
 755  		return (-1);
 756 @@ -72,7 +72,7 @@
 757  	ruserpass(*ahost, &name, &pass);
 758  /* stdlog("rexec: %s %s %s %s\n",*ahost,name,pass,cmd); */
 759  retry:
 760 -	s = socket(AF_INET, SOCK_STREAM, 0);
 761 +	s = socket(PF_FAMILY, SOCK_STREAM, 0);
 762  	if (s < 0) {
 763  		perror("rexec: socket");
 764  		return (-1);
 765 @@ -94,7 +94,7 @@
 766  		char num[8];
 767  		int s2, sin2len;
 768  		
 769 -		s2 = socket(AF_INET, SOCK_STREAM, 0);
 770 +		s2 = socket(PF_FAMILY, SOCK_STREAM, 0);
 771  		if (s2 < 0) {
 772  			(void) close(s);
 773  			return (-1);
 774 diff -ruN pvm3.old/src/OS2/src/ruserpas.c pvm3/src/OS2/src/ruserpas.c
 775 --- pvm3.old/src/OS2/src/ruserpas.c	1997-08-28 23:30:50.000000000 +0200
 776 +++ pvm3/src/OS2/src/ruserpas.c	2005-04-19 19:09:26.000000000 +0200
 777 @@ -48,11 +48,11 @@
 778  
 779  	strncpy(name, host, sizeof(name) - 1);
 780  
 781 -	if (hp = gethostbyname (name))
 782 +	if (hp = GETHOSTBYNAME (name))
 783  		strncpy(name,hp->h_name, sizeof(name) - 1);
 784  	renv(name, aname, apass);
 785  	if (*aname == 0 || *apass == 0)
 786 -		rnetrc(name,aname,apass); /*rnetrc would call gethostbyname */
 787 +		rnetrc(name,aname,apass); /*rnetrc would call GETHOSTBYNAME */
 788  	if (*aname == 0) {
 789  		*aname = getlogin();
 790  		if (*aname == NULL) {
 791 @@ -191,7 +191,7 @@
 792  	case MACHINE:
 793  		if (token() != ID)
 794  			continue;
 795 -		if(hp = gethostbyname (tokval))
 796 +		if(hp = GETHOSTBYNAME (tokval))
 797  		{
 798  			if (strcmp(host, hp->h_name))
 799  				continue;
 800 diff -ruN pvm3.old/src/pvmcruft.c pvm3/src/pvmcruft.c
 801 --- pvm3.old/src/pvmcruft.c	2001-09-27 23:25:10.000000000 +0200
 802 +++ pvm3/src/pvmcruft.c	2005-04-22 18:52:59.847757888 +0200
 803 @@ -661,17 +661,40 @@
 804  /*	hex_inadport()
 805  *
 806  *	Takes a string of format 00000000:0000 and returns a sockaddr_in.
 807 +*	Alternatively, takes a string of format [2a03:800:40ec::10]:8a43 and returns a SOCKADDR_IN
 808  */
 809  
 810  void
 811  hex_inadport(s, sad)
 812  	char *s;
 813 -	struct sockaddr_in *sad;
 814 +	struct SOCKADDR_IN *sad;
 815  {
 816 +#ifdef INET6
 817 +	char hostname[INET6_ADDRSTRLEN];
 818 +	char *aux;
 819 +	strncpy(hostname,s+1,INET6_ADDRSTRLEN);  // Shift the initial	'['
 820 +	aux = strchr(hostname,']');
 821 +	*aux = '\0';                      	 // Drop the final	']'             
 822 +	s = (s = CINDEX(s, ']')) ? s + 2 : "";  // Get the port beyond ']:'
 823 +	FAMILY_FROM_SA(*sad)=AF_FAMILY;
 824 +        inet_pton(AF_FAMILY,hostname,&ADDR_FROM_SA(*sad));
 825 +	PORT_FROM_SA(*sad) = htons((unsigned short)pvmxtoi(s));
 826 +#else
 827  	sad->sin_addr.s_addr = htonl((unsigned)pvmxtoi(s));
 828  	s = (s = CINDEX(s, ':')) ? s + 1 : "";
 829  	sad->sin_port = htons((unsigned short)pvmxtoi(s));
 830 +#endif
 831 +}
 832 +
 833 +
 834 +#ifdef INET6
 835 +const char * inet6_ntoa(const struct in6_addr in)
 836 +{
 837 +    static char buff[INET6_ADDRSTRLEN];
 838 +
 839 +    return (const char *)inet_ntop(AF_INET6, &in, buff, INET6_ADDRSTRLEN);
 840  }
 841 +#endif
 842  
 843  
 844  /*	inadport_decimal()
 845 @@ -681,11 +704,14 @@
 846  
 847  char *
 848  inadport_decimal(sad)
 849 -	struct sockaddr_in *sad;
 850 +	struct SOCKADDR_IN *sad;
 851  {
 852 +#ifdef INET6
 853 +	static char buf[INET6_ADDRSTRLEN+2+20];
 854 +	sprintf(buf, "[%s]:%d",SA_NTOA(*sad),(int)ntohs(PORT_FROM_SA(*sad)));
 855 +#else
 856  	static char buf[32];
 857  	int a;
 858 -
 859  	a = ntohl(0xffffffff & sad->sin_addr.s_addr);
 860  	sprintf(buf, "%d.%d.%d.%d:%d",
 861  			0xff & (a >> 24),
 862 @@ -693,6 +719,7 @@
 863  			0xff & (a >> 8),
 864  			0xff & a,
 865  			0xffff & (int)ntohs(sad->sin_port));
 866 +#endif
 867  	return buf;
 868  }
 869  
 870 @@ -702,15 +729,21 @@
 871  *	Returns printable string corr. to sockaddr_in with addr in hex.
 872  */
 873  
 874 +
 875  char *
 876  inadport_hex(sad)
 877 -	struct sockaddr_in *sad;
 878 +	struct SOCKADDR_IN *sad;
 879  {
 880 +#ifdef INET6
 881 +	static char buf[INET6_ADDRSTRLEN+2+20];
 882 +	sprintf(buf, "[%s]:%04x", SA_NTOA(*sad), 0xffff & ntohs(PORT_FROM_SA(*sad)));
 883 +#else
 884  	static char buf[16];
 885  	int a;
 886  
 887  	a = ntohl(0xffffffff & sad->sin_addr.s_addr);
 888  	sprintf(buf, "%08x:%04x", a, 0xffff & (int)ntohs(sad->sin_port));
 889 +#endif
 890  	return buf;
 891  }
 892  
 893 diff -ruN pvm3.old/src/pvmd.c pvm3/src/pvmd.c
 894 --- pvm3.old/src/pvmd.c	2001-09-28 14:43:18.000000000 +0200
 895 +++ pvm3/src/pvmd.c	2005-04-19 19:09:26.000000000 +0200
 896 @@ -675,6 +675,8 @@
 897  #include <pvmtev.h>
 898  #include "global.h"
 899  
 900 +#include "pvmipv6.h"
 901 +
 902  #ifdef IMA_CRAY
 903  #define MAXPATHLEN PATH_MAX+1
 904  #endif
 905 @@ -730,7 +732,7 @@
 906  char *pvmgetroot();
 907  void reap();
 908  void i_dump();
 909 -void hex_inadport __ProtoGlarp__ (( char *, struct sockaddr_in * ));
 910 +void hex_inadport __ProtoGlarp__ (( char *, struct SOCKADDR_IN * ));
 911  void mesg_rewind __ProtoGlarp__ (( struct pmsg * ));
 912  void locl_spawn();
 913  /* void make_valid(char *n); sls */
 914 @@ -1706,7 +1708,7 @@
 915  #else
 916  				int oslen;
 917  #endif
 918 -				struct sockaddr_in osad;
 919 +				struct SOCKADDR_IN osad;
 920  				struct timeval t;
 921  				char buf[DDFRAGHDR];
 922  
 923 @@ -2292,7 +2294,7 @@
 924  int
 925  netinput()
 926  {
 927 -	struct sockaddr_in osad;		/* sender's ip addr */
 928 +	struct SOCKADDR_IN osad;		/* sender's ip addr */
 929  #ifdef SOCKLENISUINT
 930  #ifdef IMA_AIX4SP2
 931  	unsigned int oslen;
 932 @@ -2381,8 +2383,8 @@
 933  	* XXX removing these lines is a hack and reduces security between
 934  	* XXX pvmds somewhat, but it's the easiest fix for Linux right now.
 935  	*/
 936 -	|| (osad.sin_addr.s_addr != hp->hd_sad.sin_addr.s_addr)
 937 -	|| (osad.sin_port != hp->hd_sad.sin_port)
 938 +	    || (!ADDR_EQUALS(ADDR_FROM_SA(osad),ADDR_FROM_SA(hp->hd_sad)))
 939 +	|| (PORT_FROM_SA(osad) != PORT_FROM_SA(hp->hd_sad))
 940  /* #endif */
 941  	) {
 942  		pvmlogprintf("netinput() bogus pkt from %s\n",
 943 @@ -4702,7 +4704,7 @@
 944  {
 945  	struct hostd *hp = hosts->ht_hosts[hosts->ht_local];
 946  	struct hostd *hp0 = hosts->ht_hosts[0];
 947 -	struct sockaddr_in sin;
 948 +	struct SOCKADDR_IN sin;
 949  	char buf[128];
 950  	char *sfn;
 951  #ifndef WIN32
 952 @@ -4737,12 +4739,12 @@
 953  	* make pvmd-pvmd socket
 954  	*/
 955  
 956 -	if ((netsock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
 957 +	if ((netsock = socket(PF_FAMILY, SOCK_DGRAM, 0)) == -1) {
 958  		pvmlogperror("mksocs() socket netsock");
 959  		return 1;
 960  	}
 961  
 962 -	hp->hd_sad.sin_port = 0;
 963 +	PORT_FROM_SA(hp->hd_sad) = 0;
 964  	oslen = sizeof(hp->hd_sad);
 965  	if (bind(netsock, (struct sockaddr*)&hp->hd_sad, oslen) == -1)
 966  	{
 967 @@ -4759,12 +4761,12 @@
 968  	* make pvmd-pvmd' socket
 969  	*/
 970  
 971 -	if ((ppnetsock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
 972 +	if ((ppnetsock = socket(PF_FAMILY, SOCK_DGRAM, 0)) == -1) {
 973  		pvmlogperror("mksocs() socket ppnetsock");
 974  		return 1;
 975  	}
 976  
 977 -	hp0->hd_sad.sin_port = 0;
 978 +	PORT_FROM_SA(hp0->hd_sad) = 0;
 979  	oslen = sizeof(hp0->hd_sad);
 980  	if (bind(ppnetsock, (struct sockaddr*)&hp0->hd_sad, oslen) == -1) {
 981  		pvmlogperror("mksocs() bind ppnetsock");
 982 @@ -4781,7 +4783,7 @@
 983  	*/
 984  
 985  #ifdef NOUNIXDOM
 986 -	if ((loclsock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
 987 +	if ((loclsock = socket(PF_FAMILY, SOCK_STREAM, 0)) == -1) {
 988  		pvmlogperror("mksocs() socket loclsock");
 989  		return 1;
 990  	}
 991 @@ -4798,24 +4800,24 @@
 992  
 993  #ifdef IMA_BEOLIN
 994  	/* allow connection from another node */
 995 -	sin.sin_family = AF_INET;
 996 +	sin.sin_family = AF_FAMILY;
 997  	if (gethostname(buf, sizeof(buf)-1) == -1) {
 998  		pvmlogerror("mksocs() can't gethostname()\n");
 999  		return 1;
1000  	} else {
1001  		/* got name, now get addr */
1002 -		if (!(hostaddr = gethostbyname( buf ))) {
1003 -			pvmlogprintf( "mksocs() can't gethostbyname() for %s\n", buf );
1004 +		if (!(hostaddr = GETHOSTBYNAME( buf ))) {
1005 +			pvmlogprintf( "mksocs() can't GETHOSTBYNAME() for %s\n", buf );
1006  			return 1;
1007  		} else {
1008  			/* got addr, now save it */
1009  			BCOPY( hostaddr->h_addr_list[0], (char*)&sin.sin_addr,
1010 -					sizeof(struct in_addr));
1011 +					sizeof(struct IN_ADDR));
1012  		}
1013  	}
1014  	sin.sin_port = 0;
1015  #else
1016 -	sin.sin_family = AF_INET;
1017 +	sin.sin_family = AF_FAMILY;
1018  	sin.sin_addr.s_addr = htonl(0x7f000001);
1019  	sin.sin_port = 0;
1020  #endif
1021 @@ -5229,17 +5231,17 @@
1022  		pvmlogperror(s);
1023  	PVM_FREE(s);
1024  
1025 -	if (!(he = gethostbyname(hp->hd_aname ? hp->hd_aname : hp->hd_name))) {
1026 -		pvmlogprintf("master_config() %s: can't gethostbyname\n", hn);
1027 +	if (!(he = GETHOSTBYNAME(hp->hd_aname ? hp->hd_aname : hp->hd_name))) {
1028 +		pvmlogprintf("master_config() %s: can't GETHOSTBYNAME\n", hn);
1029  		pvmbailout(0);
1030  	}
1031  
1032 -	BCOPY(he->h_addr_list[0], (char*)&hp->hd_sad.sin_addr,
1033 -		sizeof(struct in_addr));
1034 +	BCOPY(he->h_addr_list[0], (char*)&ADDR_FROM_SA(hp->hd_sad),
1035 +		sizeof(struct IN_ADDR));
1036  
1037  	hp = hosts->ht_hosts[0];
1038 -	BCOPY(he->h_addr_list[0], (char*)&hp->hd_sad.sin_addr,
1039 -		sizeof(struct in_addr));
1040 +	BCOPY(he->h_addr_list[0], (char*)&ADDR_FROM_SA(hp->hd_sad),
1041 +		sizeof(struct IN_ADDR));
1042  
1043  	if (pvmdebmask & (PDMHOST|PDMSTARTUP)) {
1044  		pvmlogerror("master_config() host table:\n");
1045 diff -ruN pvm3.old/src/pvmipv6.h pvm3/src/pvmipv6.h
1046 --- pvm3.old/src/pvmipv6.h	1970-01-01 01:00:00.000000000 +0100
1047 +++ pvm3/src/pvmipv6.h	2005-04-19 19:09:26.000000000 +0200
1048 @@ -0,0 +1,48 @@
1049 +
1050 +#ifndef __pvmipv6_
1051 +#define __pvmipv6_
1052 +
1053 +#ifdef INET6
1054 +#define IN_ADDR in6_addr
1055 +#define SOCKADDR_IN sockaddr_in6
1056 +#define MAXIPSTRLEN INET6_ADDRSTRLEN   /* 46 */
1057 +#define PF_FAMILY PF_INET6
1058 +#define AF_FAMILY AF_INET6
1059 +#define ADDR_IS_LOOPBACK(s) \
1060 +    (memcmp(&(s), &in6addr_loopback, sizeof(&in6addr_loopback)) == 0)
1061 +#define SA_NTOA(s)                                      \
1062 +    inet6_ntoa((s).sin6_addr)
1063 +#define ADDR_FROM_SA(s)                                 \
1064 +    ((s).sin6_addr)
1065 +#define PORT_FROM_SA(s)                                 \
1066 +    ((s).sin6_port)
1067 +#define FAMILY_FROM_SA(s)                               \
1068 +    ((s).sin6_family)
1069 +#define ADDR_EQUALS(s1,s2)                                     \
1070 +    (memcmp(&(s1), &(s2), sizeof(struct IN_ADDR)) == 0)
1071 +#define GETHOSTBYNAME(name)                             \
1072 +    gethostbyname2(name, AF_INET6)
1073 +
1074 +
1075 +#else
1076 +#define IN_ADDR in_addr
1077 +#define SOCKADDR_IN sockaddr_in
1078 +#define MAXIPSTRLEN INET_ADDRSTRLEN   /* 16 */
1079 +#define PF_FAMILY PF_INET
1080 +#define AF_FAMILY AF_INET
1081 +#define ADDR_IS_LOOPBACK(s) \
1082 +   ((s).s_addr == htonl(0x7f000001))
1083 +#define SA_NTOA(s)                                      \
1084 +    inet_ntoa((s).sin_addr)
1085 +#define ADDR_FROM_SA(s)                                 \
1086 +    ((s).sin_addr)
1087 +#define PORT_FROM_SA(s)                                 \
1088 +    ((s).sin_port)
1089 +#define FAMILY_FROM_SA(s)                               \
1090 +    ((s).sin_family)
1091 +#define ADDR_EQUALS(s1,s2)                                     \
1092 +    (memcmp(&(s1), &(s2), sizeof(struct IN_ADDR)) == 0)
1093 +#define GETHOSTBYNAME(name)                             \
1094 +    gethostbyname(name)
1095 +#endif
1096 +#endif /* not defined __pvmipv6_ */
1097 diff -ruN pvm3.old/src/SP2MPI/pvmdmimd.c pvm3/src/SP2MPI/pvmdmimd.c
1098 --- pvm3.old/src/SP2MPI/pvmdmimd.c	2001-09-25 23:19:28.000000000 +0200
1099 +++ pvm3/src/SP2MPI/pvmdmimd.c	2005-04-19 19:09:26.000000000 +0200
1100 @@ -839,13 +839,13 @@
1101  mksock()
1102  {	
1103  	struct hostd *hp = hosts->ht_hosts[hosts->ht_local];
1104 -	struct sockaddr_in sin;
1105 +	struct SOCKADDR_IN sin;
1106  	char buf[128];
1107  	char *p;
1108  	int cc;
1109  	int sock;
1110  
1111 -	if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
1112 +	if ((sock = socket(PF_FAMILY, SOCK_STREAM, 0)) == -1) {
1113  		pvmlogperror("mksock() socket");
1114  		return -1;
1115  	}
1116 diff -ruN pvm3.old/src/task.h pvm3/src/task.h
1117 --- pvm3.old/src/task.h	2000-06-16 18:27:33.000000000 +0200
1118 +++ pvm3/src/task.h	2005-04-19 19:09:26.000000000 +0200
1119 @@ -106,6 +106,7 @@
1120   *
1121   */
1122  
1123 +#include "pvmipv6.h"
1124  
1125  /* descriptor for a pvm task */
1126  
1127 @@ -122,7 +123,7 @@
1128  	int t_flag;					/* status */
1129  	int t_pid;					/* unix pid */
1130  	int t_sock;					/* t-d tcp socket */
1131 -	struct sockaddr_in t_sad;	/* addr of sock */
1132 +	struct SOCKADDR_IN t_sad;	/* addr of sock */
1133  	int t_salen;				/* addr length */
1134  	struct waitc *t_wait;		/* wait channel */
1135  	struct pkt *t_txq;			/* to task */

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-08-16 11:18:23, 34.8 KB) [[attachment:pvm3-3.3.5-v6-13082007.diff]]
  • [get | view] (2007-08-16 11:16:40, 34.8 KB) [[attachment:pvm3-3.3.5-v6-13082007.diff.txt]]
  • [get | view] (2007-08-16 11:17:49, 34.3 KB) [[attachment:pvm3-3.4.4-v6-23042005.diff]]
  • [get | view] (2007-08-16 11:16:09, 34.3 KB) [[attachment:pvm3-3.4.4-v6-23042005.diff.txt]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.