ports/67117: [maintainer] net-mgmt/ehnt fixes (0.3_5 -> 0.3_6)

Dmitry Morozovsky marck at rinet.ru
Mon May 24 08:31:09 UTC 2004


>Number:         67117
>Category:       ports
>Synopsis:       [maintainer] net-mgmt/ehnt fixes (0.3_5 -> 0.3_6)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 24 01:30:24 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Morozovsky
>Release:        FreeBSD 4-STABLE i386
>Organization:
Cronyx Plus LLC (RiNet ISP)
>Environment:
System: FreeBSD 4-STABLE 

>Description:

These patches contain fixes for net-mgmt/ehnt:
- turn off interactivity for pipe-oriented mode (colondump)
- convert ASN table from static to alloc()ed to reduce memory footprint
- bump PORTREVISION

>How-To-Repeat:

>Fix:


Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/ehnt/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile	21 May 2004 08:39:04 -0000	1.11
+++ Makefile	24 May 2004 08:17:04 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	ehnt
 PORTVERSION=	0.3
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	net-mgmt
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
Index: files/patch-ehnt-lookup
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/ehnt/files/patch-ehnt-lookup,v
retrieving revision 1.1
diff -u -r1.1 patch-ehnt-lookup
--- files/patch-ehnt-lookup	11 Aug 2001 17:38:05 -0000	1.1
+++ files/patch-ehnt-lookup	24 May 2004 08:17:04 -0000
@@ -1,8 +1,25 @@
---- ehnt_lookup.c.orig	Wed Jul 18 00:47:37 2001
-+++ ehnt_lookup.c	Fri Aug  3 19:54:34 2001
-@@ -36,7 +36,7 @@
+
+$FreeBSD$
+
+--- ehnt_lookup.c.orig	Thu Oct  4 22:18:29 2001
++++ ehnt_lookup.c	Mon May 24 12:01:50 2004
+@@ -25,7 +25,7 @@
  
-   memset(ASNs,0,sizeof(ASNs));
+ 
+ #define ASNCOUNT 65536
+-char * ASNs[ASNCOUNT];
++char ** ASNs;
+ 
+ int Init_ASN_Lookups(void) {
+ 
+@@ -34,9 +34,11 @@
+   int asn;
+   char line[100],asnname[100];
+ 
+-  memset(ASNs,0,sizeof(ASNs));
++  ASNs = calloc(ASNCOUNT, sizeof(char *));
++  if (ASNs == NULL)
++    perror("out of memory");
  
 -  if ( ! (f=fopen ("asnc.txt","r")) ) {
 +  if ( ! (f=fopen (ASNCDIR "/asnc.txt","r")) ) {
Index: files/patch-ehnt__client.c
===================================================================
RCS file: /home/ncvs/ports/net-mgmt/ehnt/files/patch-ehnt__client.c,v
retrieving revision 1.1
diff -u -r1.1 patch-ehnt__client.c
--- files/patch-ehnt__client.c	16 Nov 2002 14:36:34 -0000	1.1
+++ files/patch-ehnt__client.c	24 May 2004 08:17:04 -0000
@@ -1,9 +1,29 @@
 
-$FreeBSD: ports/net-mgmt/ehnt/files/patch-ehnt__client.c,v 1.1 2002/11/16 14:36:34 edwin Exp $
+$FreeBSD$
 
 --- ehnt_client.c.orig	Thu Oct  4 22:18:29 2001
-+++ ehnt_client.c	Thu Nov 14 22:12:07 2002
-@@ -89,7 +89,7 @@
++++ ehnt_client.c	Mon May 24 11:59:17 2004
+@@ -69,7 +69,8 @@
+    printf("Warning: can't catch interrupt signal\n");
+  }
+  fflush(stdout);
+- set_term(SET_TERM_RAW);
++ if (e_cfg->mode != EM_COLONDUMP)
++   set_term(SET_TERM_RAW);
+  setbuf(stdout,NULL);
+ 
+  for ( ; ; ) {
+@@ -78,7 +79,8 @@
+    int maxfd=sockfd;
+    
+    FD_ZERO(&read_fds);
+-   FD_SET(STDIN_FILENO,&read_fds);
++   if (e_cfg->mode != EM_COLONDUMP)
++     FD_SET(STDIN_FILENO,&read_fds);
+    FD_SET(sockfd,&read_fds);
+ 
+    fflush(stdout);
+@@ -89,7 +91,7 @@
     if (FD_ISSET(sockfd,&read_fds)) {
       ehnt_client_processmessage(sockfd,routeraddr,my_ehnt_struct);
     }
Index: files/patch-ehnt__main.c
===================================================================
RCS file: files/patch-ehnt__main.c
diff -N files/patch-ehnt__main.c
--- /dev/null	Mon May 24 12:15:22 2004
+++ files/patch-ehnt__main.c	Mon May 24 12:12:34 2004
@@ -0,0 +1,28 @@
+
+$FreeBSD$
+
+--- ehnt_main.c.orig	Thu Oct  4 22:18:29 2001
++++ ehnt_main.c	Mon May 24 12:03:14 2004
+@@ -228,14 +228,15 @@
+     e_dat.recentmin=(int)(ts->tm_min + (ts->tm_hour*60) + (ts->tm_yday * 60 * 24));
+   }
+ 
+-  NewStats(e_dat.stats);
+-
+-  Init_ASN_Lookups();
++  if (e_cfg.mode != EM_COLONDUMP) {
++    NewStats(e_dat.stats);
++    Init_ASN_Lookups();
+ 
+-  /* ehnt_client (in ehnt_client.c) connects to the server, then loops forever, 
+-     calling ProcessPacket for each incoming flow. */
+-  printf("Using report interval of %d minute(s)\n",e_cfg.si);
+-  printf("Starting. Hit '?' for help with keys.\r");
++    /* ehnt_client (in ehnt_client.c) connects to the server, then loops forever, 
++       calling ProcessPacket for each incoming flow. */
++    printf("Using report interval of %d minute(s)\n",e_cfg.si);
++    printf("Starting. Hit '?' for help with keys.\r");
++  }
+ 
+   ehnt_client(e_cfg.servername,e_cfg.serverport,&my_ehnt_struct);
+ }
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list