From owner-svn-ports-head@FreeBSD.ORG Mon Mar 23 20:47:57 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5D083B3; Mon, 23 Mar 2015 20:47:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90DAFB72; Mon, 23 Mar 2015 20:47:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2NKlvD7092863; Mon, 23 Mar 2015 20:47:57 GMT (envelope-from mi@FreeBSD.org) Received: (from mi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2NKluwx092860; Mon, 23 Mar 2015 20:47:56 GMT (envelope-from mi@FreeBSD.org) Message-Id: <201503232047.t2NKluwx092860@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mi set sender to mi@FreeBSD.org using -f From: Mikhail Teterin Date: Mon, 23 Mar 2015 20:47:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r382040 - in head/net-mgmt/tcptrack: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 20:47:57 -0000 Author: mi Date: Mon Mar 23 20:47:55 2015 New Revision: 382040 URL: https://svnweb.freebsd.org/changeset/ports/382040 QAT: https://qat.redports.org/buildarchive/r382040/ Log: Unbreak: . Fix the ancient bug, which prevented this from being compiled with delightfully picky clang++ -- thus removing the GCC-requirement added by pi@ . Remove the author's curious attempts to impose stack-size limits on the various threads of this program -- this was, what caused the program to crash at run-time . Get rid of pkg-plist (which only had two files) anyway. . Declare the LICENSE (LGPL21) Bump PORTREVISION. Approved by: port being condemned for deletion Added: head/net-mgmt/tcptrack/files/patch-const (contents, props changed) head/net-mgmt/tcptrack/files/patch-no-stack-limits (contents, props changed) Deleted: head/net-mgmt/tcptrack/pkg-plist Modified: head/net-mgmt/tcptrack/Makefile Modified: head/net-mgmt/tcptrack/Makefile ============================================================================== --- head/net-mgmt/tcptrack/Makefile Mon Mar 23 20:46:40 2015 (r382039) +++ head/net-mgmt/tcptrack/Makefile Mon Mar 23 20:47:55 2015 (r382040) @@ -1,20 +1,19 @@ # Created by: Tor Halvard "Squat" Furulund # $FreeBSD$ -PORTNAME= tcptrack -PORTVERSION= 1.4.2 -PORTREVISION= 1 -CATEGORIES= net-mgmt -MASTER_SITES= http://pkgs.fedoraproject.org/repo/pkgs/tcptrack/tcptrack-1.4.2.tar.gz/dacf71a6b5310caf1203a2171b598610/ +PORTNAME= tcptrack +PORTVERSION= 1.4.2 +PORTREVISION= 2 +CATEGORIES= net-mgmt +MASTER_SITES= http://pkgs.fedoraproject.org/repo/pkgs/tcptrack/tcptrack-1.4.2.tar.gz/dacf71a6b5310caf1203a2171b598610/ MAINTAINER= squat@squat.no COMMENT= Packet sniffer which displays TCP information like top(1) -BROKEN= binary segfaults -DEPRECATED= Broken for more than 6 months -EXPIRATION_DATE= 2015-03-28 +LICENSE= LGPL21 GNU_CONFIGURE= yes -USE_GCC= yes + +PLIST_FILES= bin/tcptrack man/man1/tcptrack.1.gz .include Added: head/net-mgmt/tcptrack/files/patch-const ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/tcptrack/files/patch-const Mon Mar 23 20:47:55 2015 (r382040) @@ -0,0 +1,22 @@ +Const is good... + + -mi + +--- src/Guesser.h 2010-09-27 19:02:01.000000000 -0400 ++++ src/Guesser.h 2015-03-23 11:42:51.000000000 -0400 +@@ -20,5 +20,5 @@ + { + public: +- bool operator()( const SocketPair &sp1, const SocketPair & sp2 ) ++ bool operator()( const SocketPair &sp1, const SocketPair & sp2 ) const + { + if( sp1==sp2 ) +--- src/TCContainer.h 2010-09-27 19:02:01.000000000 -0400 ++++ src/TCContainer.h 2015-03-23 11:40:43.000000000 -0400 +@@ -58,5 +58,5 @@ + { + public: +- bool operator()( const SocketPair &sp1, const SocketPair &sp2 ) ++ bool operator()( const SocketPair &sp1, const SocketPair &sp2 ) const + { + if( sp1==sp2 ) Added: head/net-mgmt/tcptrack/files/patch-no-stack-limits ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/tcptrack/files/patch-no-stack-limits Mon Mar 23 20:47:55 2015 (r382040) @@ -0,0 +1,160 @@ +Remove attempts to set arbitrary limits on stack-sizes for different +threads, which cause segfaults (due, presumably, to the limits being +too low). + + -mi + +--- src/defs.h 2010-09-27 19:02:01.000000000 -0400 ++++ src/defs.h 2015-03-23 16:39:53.000000000 -0400 +@@ -30,8 +30,2 @@ + //#define FASTMODE_INTERVAL 250000000 // one quarter of a second + #define FASTMODE_INTERVAL 100000000 // one tenth of a second +- +-// stack sizes for the different threads +-#define SS_PB 2048 // PacketBuffer +-#define SS_S 4096 // Sniffer 2048 -> segfault on freebsd +-#define SS_TCC 4096 // TCContainer +-#define SS_TUI 5120 // TextUI. 4096 -> segfault on solaris +--- src/PacketBuffer.cc 2010-09-27 19:02:01.000000000 -0400 ++++ src/PacketBuffer.cc 2015-03-23 16:23:36.000000000 -0400 +@@ -53,14 +53,6 @@ + // Start up maintenence thread + // +- pthread_attr_t attr; +- if( pthread_attr_init( &attr ) != 0 ) +- throw GenericError("pthread_attr_init() failed"); +- +- // TODO: there is no man page for this call on linux. Not sure what it +- // may return. On some systems it may not be supported at all +- // (should return ENOSYS). Should be safe to ignore return val. +- pthread_attr_setstacksize( &attr, SS_PB ); + +- if( pthread_create(&maint_thread_tid,&attr,pbmaint_thread_func,this) != 0 ) ++ if (pthread_create(&maint_thread_tid, NULL, pbmaint_thread_func, this) != 0) + throw GenericError("pthread_create() returned an error"); + +--- src/Sniffer.cc 2010-09-27 19:02:22.000000000 -0400 ++++ src/Sniffer.cc 2015-03-23 16:25:10.000000000 -0400 +@@ -55,5 +66,5 @@ + } + +-void Sniffer::init(char *iface, char *fexp, char *test_file) ++void Sniffer::init(const char *iface, const char *fexp, const char *test_file) + { + assert(pcap_initted==false); +@@ -89,6 +102,4 @@ + // prepare the filter + // +- struct bpf_program filter; // the filter for the sniffer +- char *filter_app = fexp; // The filter expression + bpf_u_int32 mask; // The netmask of our sniffing device + bpf_u_int32 net; // The IP of our sniffing device +@@ -102,28 +113,23 @@ + mask = 0; + } +- if( pcap_compile(handle, &filter, filter_app, 0, net) == -1 ) +- { +- pcap_close(handle); +- throw PcapError("pcap_compile",pcap_geterr(handle)); +- } +- if( pcap_setfilter(handle, &filter) ) // apply filter to sniffer +- { +- pcap_freecode(&filter); +- pcap_close(handle); +- throw PcapError("pcap_setfilter",pcap_geterr(handle)); ++ if (fexp != NULL && fexp[0] != '\0') { ++ struct bpf_program filter; // the filter for the sniffer ++ if (pcap_compile(handle, &filter, fexp, 0, net) == -1) ++ { ++ pcap_close(handle); ++ throw PcapError("pcap_compile", pcap_geterr(handle)); ++ } ++ if (pcap_setfilter(handle, &filter)) // apply filter to sniffer ++ { ++ pcap_freecode(&filter); ++ pcap_close(handle); ++ throw PcapError("pcap_setfilter", pcap_geterr(handle)); ++ } ++ pcap_freecode(&filter); // filter code not needed after setfilter + } +- pcap_freecode(&filter); // filter code not needed after setfilter +- +- pcap_initted=true; +- + +- pthread_attr_t attr; +- +- if( pthread_attr_init( &attr ) != 0 ) +- throw GenericError("pthread_attr_init() failed"); +- +- pthread_attr_setstacksize( &attr, SS_S ); ++ pcap_initted=true; + +- if( pthread_create(&sniffer_tid,&attr,sniffer_thread_func,this) != 0 ) ++ if (pthread_create(&sniffer_tid, NULL, sniffer_thread_func, this) != 0) + throw GenericError("pthread_create() failed."); + +@@ -163,9 +170,11 @@ + void Sniffer::processPacket( const pcap_pkthdr *header, const u_char *packet ) + { +- assert( pthread_mutex_lock(&pb_mutex)==0 ); ++ ++ if (pthread_mutex_lock(&pb_mutex) != 0) ++ return; + + if( pb==NULL ) + { +- assert( pthread_mutex_unlock(&pb_mutex) == 0 ); ++ pthread_mutex_unlock(&pb_mutex); + return; + } +@@ -193,5 +202,5 @@ + pb->pushPacket(n); + +- assert( pthread_mutex_unlock(&pb_mutex) == 0 ); ++ pthread_mutex_unlock(&pb_mutex); + } + +--- src/Sniffer.h 2010-09-27 19:02:22.000000000 -0400 ++++ src/Sniffer.h 2015-03-23 15:07:57.000000000 -0400 +@@ -43,5 +43,5 @@ + // init performs some constructor-like activity. It is separate + // so that exceptions don't have to be thrown in the constructor. +- void init(char *iface, char *fexp, char *test_file); ++ void init(const char *iface, const char *fexp, const char *test_file); + + // set the place where sniffed packets are sent for further +--- src/TCContainer.cc 2010-09-27 19:02:01.000000000 -0400 ++++ src/TCContainer.cc 2015-03-23 16:23:05.000000000 -0400 +@@ -47,15 +47,8 @@ + state=TSTATE_IDLE; + +- pthread_attr_t attr; +- + pthread_mutex_init( &conlist_lock, NULL ); + pthread_mutex_init( &state_mutex, NULL ); + +- if( pthread_attr_init( &attr ) != 0 ) +- throw GenericError("pthread_attr_init() failed"); +- +- pthread_attr_setstacksize( &attr, SS_TCC ); +- +- if( pthread_create(&maint_thread_tid,&attr,maint_thread_func,this) != 0 ) ++ if( pthread_create(&maint_thread_tid, NULL, maint_thread_func, this) != 0 ) + throw GenericError("pthread_create() failed."); + +--- src/TextUI.cc 2011-08-03 13:34:45.000000000 -0400 ++++ src/TextUI.cc 2015-03-23 16:24:20.000000000 -0400 +@@ -80,11 +80,5 @@ + run_displayer = true; + +- pthread_attr_t attr; +- if( pthread_attr_init( &attr ) != 0 ) +- throw GenericError("pthread_attr_init() failed"); +- +- pthread_attr_setstacksize( &attr, SS_TUI ); +- +- if( pthread_create(&displayer_tid,&attr,displayer_thread_func,this) != 0 ) ++ if (pthread_create(&displayer_tid, NULL, displayer_thread_func, this) != 0) + throw GenericError("pthread_create() returned an error."); +