diff options
author | kim <kim> | 1998-08-08 21:28:32 +0000 |
---|---|---|
committer | kim <kim> | 1998-08-08 21:28:32 +0000 |
commit | b660d914de90f9dafaaf1a488d711db5e641f8d6 (patch) | |
tree | 0b07d4a23f910d04221a907c9706c8b24bb3152a /net/ntop | |
parent | ac67645873131ed94a79f29f30c91a68b6720a45 (diff) | |
download | pkgsrc-b660d914de90f9dafaaf1a488d711db5e641f8d6.tar.gz |
The logic for determining the local domain was wrong.
Using gethostname(3) instead (could use gethostbyname(3)
on top of that, I guess...).
Diffstat (limited to 'net/ntop')
-rw-r--r-- | net/ntop/patches/patch-ab | 11 | ||||
-rw-r--r-- | net/ntop/patches/patch-af | 51 |
2 files changed, 58 insertions, 4 deletions
diff --git a/net/ntop/patches/patch-ab b/net/ntop/patches/patch-ab index f1e9c68e7af..2783089d3a8 100644 --- a/net/ntop/patches/patch-ab +++ b/net/ntop/patches/patch-ab @@ -1,8 +1,8 @@ -$NetBSD: patch-ab,v 1.1 1998/08/07 22:42:29 kim Exp $ +$NetBSD: patch-ab,v 1.2 1998/08/08 21:28:32 kim Exp $ --- ntop.h.orig Fri Jul 31 12:31:45 1998 -+++ ntop.h Fri Aug 7 18:07:14 1998 -@@ -16,7 +16,13 @@ ++++ ntop.h Sat Aug 8 17:19:25 1998 +@@ -16,9 +16,16 @@ #endif #include <errno.h> @@ -16,8 +16,11 @@ $NetBSD: patch-ab,v 1.1 1998/08/07 22:42:29 kim Exp $ +#endif #include <ctype.h> #include <sys/types.h> ++#include <sys/param.h> #include <unistd.h> -@@ -38,7 +44,6 @@ + #include <sys/socket.h> + #include <sys/select.h> +@@ -38,7 +45,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/net/ntop/patches/patch-af b/net/ntop/patches/patch-af new file mode 100644 index 00000000000..253c1fe352b --- /dev/null +++ b/net/ntop/patches/patch-af @@ -0,0 +1,51 @@ +--- pbuf.c.orig Mon Aug 3 08:50:07 1998 ++++ pbuf.c Sat Aug 8 17:22:28 1998 +@@ -100,7 +100,7 @@ + /* Static */ + static clock_t lastTime; + static int lastNumLines, lastNumCols; +-static char domainName[64]; ++static char domainName[MAXHOSTNAMELEN]; + static short sortSendMode=0; + static char hex[] = "0123456789ABCDEF"; + static short screenNumber=0; +@@ -289,6 +289,8 @@ + + void init_curses () + { ++ char *p; ++ + if(webMode) return; + + initscr (); +@@ -305,7 +307,12 @@ + + lastNumLines = LINES; + lastNumCols = COLS; +- domainName[0] = '\0'; ++ if ((gethostname(domainName, MAXHOSTNAMELEN) == 0) ++ && ((p = memchr(domainName, '.', MAXHOSTNAMELEN)) != NULL)) { ++ domainName[MAXHOSTNAMELEN - 1] = '\0'; ++ memmove(domainName, ++p, MAXHOSTNAMELEN + domainName - p); ++ } else ++ domainName[0] = '\0'; + printHeader(); + } + +@@ -418,16 +425,6 @@ + if (hp && (hp->h_name)) { + char *dotp = (char*)hp->h_name; + +- if((domainName[0] == '\0') +- && ((hostIpAddress.s_addr & netmask) == localnet)) { +- int i; +- +- for(i=0; dotp[i] != '\0' && dotp[i] != '.'; i++); +- +- if((dotp[i] == '.') && (isalpha(dotp[strlen(dotp)-1]))) +- strcpy(domainName, &dotp[i+1]); +- } +- + if(domainName[0] != '\0') { + int len = strlen(dotp)-strlen(domainName); + |