svn commit: r407636 - in head/net-mgmt/rate: . files

Michael Landin Hostbaek mich at FreeBSD.org
Sun Jan 31 13:48:59 UTC 2016


Author: mich
Date: Sun Jan 31 13:48:57 2016
New Revision: 407636
URL: https://svnweb.freebsd.org/changeset/ports/407636

Log:
  - fix IP truncation and add license info
  
  PR:		206782
  Submitted by:	Franco Fichtner (franco at opnsense.org)

Added:
  head/net-mgmt/rate/files/patch-streamstat.c   (contents, props changed)
Modified:
  head/net-mgmt/rate/Makefile
  head/net-mgmt/rate/files/patch-rate.c

Modified: head/net-mgmt/rate/Makefile
==============================================================================
--- head/net-mgmt/rate/Makefile	Sun Jan 31 13:44:41 2016	(r407635)
+++ head/net-mgmt/rate/Makefile	Sun Jan 31 13:48:57 2016	(r407636)
@@ -3,12 +3,16 @@
 
 PORTNAME=	rate
 PORTVERSION=	0.9
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	http://s-tech.elsat.net.pl/bmtools/
 
 MAINTAINER=	mich at FreeBSD.org
 COMMENT=	Traffic analysis command-line utility
 
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/COPYING
+
 MAKE_ARGS=	CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
 LDFLAGS+=	-lcompat
 CFLAGS+=	-DOPEN_BSD=1 -DHAVE_REGEX -DSTREAM_ANALYZER -DIOCTL_GETWINSIZE -DAUTOSENSE_DLH

Modified: head/net-mgmt/rate/files/patch-rate.c
==============================================================================
--- head/net-mgmt/rate/files/patch-rate.c	Sun Jan 31 13:44:41 2016	(r407635)
+++ head/net-mgmt/rate/files/patch-rate.c	Sun Jan 31 13:48:57 2016	(r407636)
@@ -1,6 +1,6 @@
---- rate.c.orig
+--- rate.c.orig	2003-08-20 15:22:28 UTC
 +++ rate.c
-@@ -74,6 +74,7 @@
+@@ -74,6 +74,7 @@ int opt_separator = 0;
  int opt_cls = 0;
  int opt_dns = 1;
  int opt_cols = 80;
@@ -8,7 +8,7 @@
  
  #ifdef HAVE_REGEX
  char * opt_regex = NULL;
-@@ -214,6 +215,7 @@
+@@ -214,6 +215,7 @@ void help(unsigned char * name)
  	printf("  -p <pref> Datalink layer header size (gets substracted from each packet size, default: 14)\n");
  	printf("  -s <b>    Capture l bytes (default: 40)\n");
  	printf("  -i <int>  Bind to interface <int> - default eth0\n");
@@ -16,7 +16,7 @@
  	printf("  -n        Numeric IPs. Don't do reverse DNS lookups.\n");
  	printf("  -c        Use colors (ANSI-compatible) whenever possible.\n");
  	printf("  -v        Print exact values, do not use SI prefixes.\n");
-@@ -264,7 +266,7 @@
+@@ -264,7 +266,7 @@ int main(int argc, char ** argv)
  		}
  	}
  	
@@ -25,7 +25,7 @@
  	{
  		if(c == 'R' || c == 'A' || c == 'T' || c == 'E')
  			break;
-@@ -284,6 +286,7 @@
+@@ -284,6 +286,7 @@ int main(int argc, char ** argv)
  			case 'k': opt_onkeyboard = 1; break;
  			case 'c': opt_color = 1; break;
  			case 'v': opt_human = 0; break;
@@ -33,7 +33,7 @@
  			case 'e': opt_separator = 1; break;
  			case 'w': opt_cls = 1; break;
  			case 'n': opt_dns = 0; break;
-@@ -311,7 +314,7 @@
+@@ -311,7 +314,7 @@ int main(int argc, char ** argv)
  		}
  	}
  

Added: head/net-mgmt/rate/files/patch-streamstat.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/rate/files/patch-streamstat.c	Sun Jan 31 13:48:57 2016	(r407636)
@@ -0,0 +1,10 @@
+--- streamstat.c.orig	2016-01-15 08:36:19 UTC
++++ streamstat.c
+@@ -282,6 +282,7 @@ char * customize_format(int cols, int ou
+ {
+ 	static char fmtstring[256];
+ 	int n = (cols - outlen - 1) / 2;
++	if (n < 15) n = 15;	/* minimum required chars for IPv4 */
+ 	snprintf(fmtstring, 256, fmt, n, n, n, n);
+ 	return(fmtstring);
+ }


More information about the svn-ports-head mailing list