diff -urw nntp-1.5.12.2/Makefile nntp-1.5.12.2-IPv6/Makefile
--- nntp-1.5.12.2/Makefile	Tue Jan  9 08:30:24 1996
+++ nntp-1.5.12.2-IPv6/Makefile	Sun Oct 21 20:13:31 2001
@@ -4,7 +4,7 @@
 # The program that knows how to deal with makefiles. [Uncomment if needed.]
 # MAKE=make
 # set CFLAGS to be -Ipath/to/special/includes if needed
-CFLAGS= -O 
+CFLAGS= -O  -g -I/usr/local/src/cnews.CR-G/libdbz -Wall -DDO_DEBUG
 #Uncomment the following for Solaris (and similiar SVR4 systems)
 #NETLIBS   = -lsocket -lnsl 
 #Uncomment the following if the previous one does not work
@@ -13,6 +13,7 @@
 #DBLIBS	= -ldbz
 #DBLIBS	= /usr/local/lib/dbz.o #/usr/local/lib/dbzdbm.o
 #DBLIBS	= -ldbm
+DBLIBS = /usr/local/src/cnews.CR-G/libcnews.a -lcrypt
 # add the resolver library if needed
 #RESLIB = -lresolv
 # add the kmem library if needed 
@@ -20,7 +21,7 @@
 #Uncomment the following for Solaris (and similiar SVR4 systems)
 #KVMLIB = -lelf
 # Where nntpd is going to live
-ETCDIR = /etc
+ETCDIR = /usr/local/etc
 # Where nntpxmit and nntpxfer is going to live
 BINDIR = /usr/local/bin
 # Where manual pages live
Only in nntp-1.5.12.2-IPv6: conf.h
diff -urw nntp-1.5.12.2/server/access.c nntp-1.5.12.2-IPv6/server/access.c
--- nntp-1.5.12.2/server/access.c	Sat Dec  3 22:54:38 1994
+++ nntp-1.5.12.2-IPv6/server/access.c	Sun Oct 21 20:12:12 2001
@@ -11,6 +11,10 @@
 #endif
 #include <sys/socket.h>
 
+#ifdef __NetBSD__
+# include <netdb.h>
+#endif
+
 #define	SNETMATCH	1
 #define	NETMATCH	2
 
@@ -60,7 +64,7 @@
 {
 	int		sockt;
 	int		length;
-	struct sockaddr	sa;
+	struct sockaddr_storage sa;
 #ifdef TLI
 	struct sockaddr_in *sin = (struct sockaddr_in *) &sa;
 	struct hostent	*hp;
@@ -128,9 +132,10 @@
 #endif
 #endif /* !TLI */
 
-	switch (sa.sa_family) {
+	switch (sa.ss_family) {
 	case AF_INET:
-		inet_netnames(sockt, &sa, net_name, snet_name, host_name);
+		inet_netnames(sockt, (struct sockaddr *)&sa, 
+                              net_name, snet_name, host_name);
 		break;
 
 #ifdef DECNET
@@ -138,10 +143,18 @@
 		dnet_netnames(sockt, &sa, net_name, snet_name, host_name);
 		break;
 #endif
-
+	case AF_INET6:
+		getnameinfo( (struct sockaddr *) &sa, sa.ss_len, 
+				host_name, sizeof(host_name), NULL, 0, 0 );
+		net_name[0] = snet_name[0] = '\0';
+#ifdef SYSLOG
+		syslog(LOG_DEBUG, "yippee! IPv6 connect from %s (%d->%d/%d)",
+			 host_name, sizeof(sa), length, sa.ss_len );
+#endif
+		break;
 	default:
 #ifdef SYSLOG
-		syslog(LOG_ERR, "unknown address family %ld", sa.sa_family);
+		syslog(LOG_ERR, "unknown address family %d", sa.ss_family);
 #endif
 		return;
 	};
diff -urw nntp-1.5.12.2/server/active.c nntp-1.5.12.2-IPv6/server/active.c
--- nntp-1.5.12.2/server/active.c	Tue Nov  1 06:40:09 1994
+++ nntp-1.5.12.2-IPv6/server/active.c	Sun Oct 21 20:13:24 2001
@@ -31,10 +31,10 @@
 int
 read_groups()
 {
-	register int	i;
-	register int	act_fd;
-	register char	*cp, *end;
-	char		*malloc();
+	int	i;
+	int	act_fd;
+	int rc;
+	char	*cp, *end;
 	struct stat	statbuf;
 
 	/*
@@ -63,7 +63,7 @@
 		return (0);
 	}
 
-	actbuf = malloc(statbuf.st_size);
+	actbuf = malloc((size_t)statbuf.st_size);
 	if (actbuf == NULL) {
 #ifdef SYSLOG
 		syslog(LOG_ERR, "read_groups: malloc %d bytes: %m",
@@ -73,10 +73,17 @@
 		return (0);
 	}
 
-	if (read(act_fd, actbuf, (iolen_t)statbuf.st_size) != statbuf.st_size) {
+#ifdef DO_DEBUG
+	syslog(LOG_DEBUG, "read_groups: %s, len=%d, fd=%d, p=%08x", 
+		activefile, (int) statbuf.st_size, act_fd, (int) actbuf );
+#endif
+
+	/* if (read(act_fd, actbuf, (iolen_t)statbuf.st_size) != statbuf.st_size) { */
+	rc = read(act_fd, actbuf, (int)statbuf.st_size);
+	if ( rc != statbuf.st_size) {
 #ifdef SYSLOG
-		syslog(LOG_ERR, "read_groups: read %d bytes: %m",
-			statbuf.st_size);
+		syslog(LOG_ERR, "read_groups: read %d bytes -> %d: %m",
+			(int)statbuf.st_size, rc);
 #endif
 		(void) close(act_fd);
 		return (0);
diff -urw nntp-1.5.12.2/server/batch.c nntp-1.5.12.2-IPv6/server/batch.c
--- nntp-1.5.12.2/server/batch.c	Fri Dec  9 03:52:44 1994
+++ nntp-1.5.12.2-IPv6/server/batch.c	Sun Oct 21 01:24:19 2001
@@ -31,7 +31,6 @@
 
 /* imports */
 extern time_t time();
-extern char *malloc(), *mktemp(), *index(), *rindex();
 /* forwards */
 static char *strsave();
 #ifdef XFER_TIMEOUT
diff -urw nntp-1.5.12.2/server/common.h nntp-1.5.12.2-IPv6/server/common.h
--- nntp-1.5.12.2/server/common.h	Thu Nov 17 19:15:18 1994
+++ nntp-1.5.12.2-IPv6/server/common.h	Sun Oct 21 01:22:36 2001
@@ -7,6 +7,7 @@
 
 #include "../conf.h"
 #include <stdio.h>
+#include <stdlib.h>
 #ifndef BSD_42
 #include <sys/types.h>
 #endif /* BSD_42 */
@@ -14,6 +15,7 @@
 #include <sys/stat.h>
 #include <errno.h>
 #include <ctype.h>
+#include <unistd.h>
 #include <pwd.h>
 #include <sys/file.h>
 #ifdef BSD2_10
@@ -219,3 +221,12 @@
 extern	int	nn_told;
 extern	int	nn_took;
 #endif
+
+/* prototypes */
+void host_access( int *canread, int *canpost, int *canxfer, char *gdlist );
+int space(int min_free );
+int get_nglist( char ***array, char *list );
+int read_groups(void);
+int parsit( char * line, char ***array );
+
+
diff -urw nntp-1.5.12.2/server/group.c nntp-1.5.12.2-IPv6/server/group.c
--- nntp-1.5.12.2/server/group.c	Sat Dec  3 22:54:51 1994
+++ nntp-1.5.12.2-IPv6/server/group.c	Sun Oct 21 01:25:53 2001
@@ -11,7 +11,6 @@
 extern void close_xfiles();
 #endif
 
-extern char *malloc();
 
 /*
  * GROUP newsgroup
diff -urw nntp-1.5.12.2/server/main.c nntp-1.5.12.2-IPv6/server/main.c
--- nntp-1.5.12.2/server/main.c	Thu Nov 17 19:15:19 1994
+++ nntp-1.5.12.2-IPv6/server/main.c	Sun Oct 21 00:48:43 2001
@@ -270,6 +270,7 @@
  * clobber argv so ps will show what we're doing.
  * stolen from sendmail
  */
+#ifndef __NetBSD__
 #ifdef SETPROCTITLE
 #if defined(sun) || defined(hpux)
 /*VARARGS*/
@@ -331,3 +332,4 @@
 }
 #endif /* hpux */
 #endif /* SETPROCTITLE */
+#endif /* __NetBSD__ */
diff -urw nntp-1.5.12.2/server/misc.c nntp-1.5.12.2-IPv6/server/misc.c
--- nntp-1.5.12.2/server/misc.c	Tue Jan  9 08:28:04 1996
+++ nntp-1.5.12.2-IPv6/server/misc.c	Sat Oct 20 23:58:03 2001
@@ -996,7 +996,7 @@
 #ifdef bsdi
 #define KERNEL_FILE "/bsd"
 #else
-#define KERNEL_FILE "/vmunix"
+#define KERNEL_FILE "/netbsd"
 #endif
 #endif
 
@@ -1012,6 +1012,13 @@
 int
 getla()
 {
+#ifdef __NetBSD__
+	double avenrun[3];
+	avenrun[0] = 0;
+	getloadavg( avenrun, 3 );
+	return ((int) (avenrun[0] + 0.5));
+
+#else	/* not __NetBSD__ */
 	static int kmem = -1;
 # ifdef FSCALE
 	long avenrun[3];
@@ -1056,6 +1063,7 @@
 # else
 	return ((int) (avenrun[0] + 0.5));
 # endif
+#endif /* __NetBSD__ */
 }
 #endif
 #endif /* LOAD */
diff -urw nntp-1.5.12.2/server/msgidd.c nntp-1.5.12.2-IPv6/server/msgidd.c
--- nntp-1.5.12.2/server/msgidd.c	Fri Dec  9 03:53:01 1994
+++ nntp-1.5.12.2-IPv6/server/msgidd.c	Sun Oct 21 01:25:56 2001
@@ -34,7 +34,6 @@
 #define dprintf (void)
 #endif
 
-char *malloc();
 extern int errno;
 
 int log = 0, flags = 0;
diff -urw nntp-1.5.12.2/server/parsit.c nntp-1.5.12.2-IPv6/server/parsit.c
--- nntp-1.5.12.2/server/parsit.c	Tue Nov  1 06:40:58 1994
+++ nntp-1.5.12.2-IPv6/server/parsit.c	Sun Oct 21 01:26:00 2001
@@ -33,7 +33,6 @@
 
 #include <stdio.h>
 
-extern	char	*malloc(), *strcpy();
 
 int
 parsit(line, array)
diff -urw nntp-1.5.12.2/server/scandir.c nntp-1.5.12.2-IPv6/server/scandir.c
--- nntp-1.5.12.2/server/scandir.c	Sat Nov  5 07:04:53 1994
+++ nntp-1.5.12.2-IPv6/server/scandir.c	Sun Oct 21 01:26:04 2001
@@ -21,7 +21,6 @@
  */
 
 extern	int	intcmp();
-extern char *malloc(), *realloc();
 
 int
 scan_dir(low_msg, high_msg)
diff -urw nntp-1.5.12.2/server/xauth.c nntp-1.5.12.2-IPv6/server/xauth.c
--- nntp-1.5.12.2/server/xauth.c	Fri Dec  9 03:53:20 1994
+++ nntp-1.5.12.2-IPv6/server/xauth.c	Sun Oct 21 01:26:07 2001
@@ -30,7 +30,7 @@
 extern char	Host[];
 
 /* forward declarations */
-void getpass();
+void getnnpass();
 void getuser();
 
  
@@ -59,7 +59,6 @@
 	union wait status;
 #endif
 	struct stat stb;
-	char *malloc();
 
 	av += 2;
 
@@ -249,7 +248,7 @@
 			fflush(stdout);
 			return;
 		}
-		getpass(argv[2]);
+		getnnpass(argv[2]);
 		return;
 	}
 #ifdef GENAUTH
@@ -301,7 +300,7 @@
 
 /* password */
 void
-getpass(p)
+getnnpass(p)
 char *p;
 {
 	static char pass[10];
diff -urw nntp-1.5.12.2/server/xover.c nntp-1.5.12.2-IPv6/server/xover.c
--- nntp-1.5.12.2/server/xover.c	Tue Nov  1 07:09:24 1994
+++ nntp-1.5.12.2-IPv6/server/xover.c	Sun Oct 21 01:26:11 2001
@@ -213,7 +213,6 @@
 		} while (c != EOF && c != '\n' && c != '\t');
 		printf("\r\n");
 	} else {
-		char		*malloc(), *realloc();
 		register int	size = 1024;
 		buf = malloc(size);
 		if (buf) {
diff -urw nntp-1.5.12.2/support/acttimes.c nntp-1.5.12.2-IPv6/support/acttimes.c
--- nntp-1.5.12.2/support/acttimes.c	Tue Jan  9 08:28:02 1996
+++ nntp-1.5.12.2-IPv6/support/acttimes.c	Sun Oct 21 01:26:23 2001
@@ -77,7 +77,6 @@
 
 extern errno;
 
-char *index(), *rindex(), *malloc();
 SIGRET alarm_handler(), quit_handler();
 void active_times(), free_lines(), wrap_it_up();
 
diff -urw nntp-1.5.12.2/xfer/nntpxfer.c nntp-1.5.12.2-IPv6/xfer/nntpxfer.c
--- nntp-1.5.12.2/xfer/nntpxfer.c	Tue Jan  9 08:28:03 1996
+++ nntp-1.5.12.2-IPv6/xfer/nntpxfer.c	Sun Oct 21 01:31:42 2001
@@ -61,6 +61,8 @@
 #endif
 
 #include <stdio.h>
+#include <string.h>
+#include <unistd.h>
 #include <errno.h>
 #include <ctype.h>
 #include <setjmp.h>
@@ -101,10 +103,6 @@
 #ifdef linux
 #define __SERR _IO_ERR_SEEN
 #endif
-char	*malloc();
-char	*strcpy();
-char	*strcat();
-char	*rindex();
 u_long	inet_addr();
 
 extern int errno;
@@ -647,7 +645,9 @@
 int code;
 {
 	extern int sys_nerr;
+#ifndef __NetBSD__
 	extern char *sys_errlist[];
+#endif
 	static char ebuf[6+5+1];
 
 	if (code > sys_nerr || code < 0) {
diff -urw nntp-1.5.12.2/xmit/get_tcp_conn.c nntp-1.5.12.2-IPv6/xmit/get_tcp_conn.c
--- nntp-1.5.12.2/xmit/get_tcp_conn.c	Thu Nov 17 19:15:22 1994
+++ nntp-1.5.12.2-IPv6/xmit/get_tcp_conn.c	Sat Feb 23 20:44:10 2002
@@ -28,6 +28,7 @@
 #ifndef	NONETDB
 #include <netdb.h>
 #endif	/* NONETDB */
+#include <syslog.h>
 
 extern	int	errno;
 extern	char	*Pname;
@@ -283,6 +284,50 @@
 	sp.sp_protocol	= (u_short)IPPROTO_TCP;
 #endif	/* OLDSOCKET */
 
+#ifndef PRE_IPv6
+	/* see "man getaddrinfo()" */
+	struct addrinfo hints, *addrs, *ai_p;
+	int r;
+
+	memset( &hints, 0, sizeof(hints) );
+	hints.ai_family = PF_UNSPEC;
+	hints.ai_socktype = SOCK_STREAM;
+	if ( (r = getaddrinfo( host, "nntp", &hints, &addrs )) != 0 )
+	{ 
+	    fprintf( stderr, "getaddrinfo(%s/nntp): %s", host, 
+			gai_strerror(r));
+	    return(NOHOST);
+	}
+	sock=-1;
+	for( ai_p = addrs; ai_p != NULL; ai_p = ai_p->ai_next )
+	{
+	    sock = socket( ai_p->ai_family, ai_p->ai_socktype, 
+                           ai_p->ai_protocol);
+	    if ( sock < 0 ) {continue;}
+	    if ( connect( sock, ai_p->ai_addr, ai_p->ai_addrlen ) < 0 )
+	    {
+		fprintf( stderr, "connect() failed: %s", strerror(errno));
+		close(sock); 
+		sock=-1;
+		continue;
+	    }
+	    if ( ai_p->ai_family == AF_INET6 )
+	    {
+		char addrbuf[100];
+		inet_ntop( ai_p->ai_family, ai_p->ai_addr, 
+                           &addrbuf, sizeof(addrbuf) );
+		syslog(LOG_INFO, "IPv6 connect to %s (%s) - yeah!",
+			 host, addrbuf );
+	    }
+	    break;
+	}
+	freeaddrinfo(addrs);
+	if ( sock < 0 ) { return(FAIL); }
+
+	/* TODO: keepalives! */
+	return(sock);
+
+#else /*PRE_IPv6*/
 	if ((addrlist = name_to_address(host)) == (u_long **)NULL) {
 		return(NOHOST);
 	}
@@ -327,4 +372,5 @@
 								    }
 	}
 	return(FAIL);
+#endif /* PRE_IPv6 */
 }
diff -urw nntp-1.5.12.2/xmit/nntpxmit.c nntp-1.5.12.2-IPv6/xmit/nntpxmit.c
--- nntp-1.5.12.2/xmit/nntpxmit.c	Sat Dec  3 23:37:58 1994
+++ nntp-1.5.12.2-IPv6/xmit/nntpxmit.c	Sat Oct 20 23:48:10 2001
@@ -516,7 +516,9 @@
 int code;
 {
 	extern int sys_nerr;
+#ifndef __NetBSD__
 	extern char *sys_errlist[];
+#endif
 	static char ebuf[6+5+1];
 
 	if (code > sys_nerr || code < 0) {
diff -urw nntp-1.5.12.2/xmit/shlock.c nntp-1.5.12.2-IPv6/xmit/shlock.c
--- nntp-1.5.12.2/xmit/shlock.c	Tue Nov  1 06:54:32 1994
+++ nntp-1.5.12.2-IPv6/xmit/shlock.c	Sat Oct 20 23:48:55 2001
@@ -119,7 +119,9 @@
 register int	n;
 {
 	extern	int	sys_nerr;
+#ifndef __NetBSD__
 	extern 	char	*sys_errlist[];
+#endif
 
 	return((n >= 0 && n < sys_nerr) ? sys_errlist[n] : "unknown error");
 }
