Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2006 18:17:14 +0100 (CET)
From:      Rudolf Cejka <cejkar@fit.vutbr.cz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/92694: net/trafshow upgrade to 5.2.2 with better patches for FreeBSD
Message-ID:  <200602011717.k11HHEui060531@kazi.fit.vutbr.cz>
Resent-Message-ID: <200602011720.k11HK39Q098673@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         92694
>Category:       ports
>Synopsis:       net/trafshow upgrade to 5.2.2 with better patches for FreeBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 01 17:20:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Rudolf Cejka
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
FIT, Brno University of Technology, Czech Republic
>Environment:
>Description:
 
 Below is a patch (apply it with -p0 in /usr/ports/net directory please)
 for update of net/trafshow from 5.2.1 to 5.2.2. There is not a functional
 change from 5.2.1 to 5.2.2 (it was just preparation for gcc 4.0), however
 the patch contains much better workaround for bpf non-blocking brokenness
 in FreeBSD's kernel (kern/84823). Now it should produce results like
 trafshow3 with much better interactivity, IPv6 and some other possibilities.
 
 diff -urN trafshow.save/Makefile trafshow/Makefile
 --- trafshow.save/Makefile	Wed Feb  1 17:49:17 2006
 +++ trafshow/Makefile	Wed Feb  1 18:06:18 2006
 @@ -6,12 +6,10 @@
  #
  
  PORTNAME=	trafshow
 -PORTVERSION=	5.2.1
 -PORTREVISION=	1
 +PORTVERSION=	5.2.2
  PORTEPOCH=	1
  CATEGORIES=	net
 -MASTER_SITES=	${MASTER_SITE_NETBSD} \
 -		ftp://ftp.nsk.su/pub/RinetSoftware/
 +MASTER_SITES=	ftp://ftp.nsk.su/pub/RinetSoftware/
  EXTRACT_SUFX=	.tgz
  
  MAINTAINER=	ports@FreeBSD.org
 diff -urN trafshow.save/distinfo trafshow/distinfo
 --- trafshow.save/distinfo	Wed Feb  1 17:13:48 2006
 +++ trafshow/distinfo	Wed Feb  1 18:06:18 2006
 @@ -1,3 +1,3 @@
 -MD5 (trafshow-5.2.1.tgz) = e3ad2e3f1aac2e1bac9b467df44cf8f0
 -SHA256 (trafshow-5.2.1.tgz) = 7aa55cd88fe25b212ef15420fdf4a812d8296f6df3005ea77cde7c6716e9c574
 -SIZE (trafshow-5.2.1.tgz) = 123770
 +MD5 (trafshow-5.2.2.tgz) = 6fbf6668b87415ff0baa75021204a264
 +SHA256 (trafshow-5.2.2.tgz) = 7b6b014d9e67c9a09e66caa002208071d603067782c3b86e1ddb9a6aefe5ff25
 +SIZE (trafshow-5.2.2.tgz) = 124191
 diff -urN trafshow.save/files/patch-show_dump.c trafshow/files/patch-show_dump.c
 --- trafshow.save/files/patch-show_dump.c	Thu Jan  1 01:00:00 1970
 +++ trafshow/files/patch-show_dump.c	Wed Feb  1 18:08:17 2006
 @@ -0,0 +1,31 @@
 +--- show_dump.c.orig	Mon Jul 12 07:21:09 2004
 ++++ show_dump.c	Wed Feb  1 18:07:01 2006
 +@@ -21,6 +21,7 @@
 + #include <sys/param.h>
 + #include <sys/types.h>
 + #include <sys/socket.h>
 ++#include <sys/ioctl.h>
 + #include <sys/time.h>
 + #include <netinet/in.h>
 + #include <arpa/inet.h>
 +@@ -118,6 +119,7 @@
 +         bpf_u_int32 net;
 +         bpf_u_int32 mask;
 + 	char name[100], buf[256];
 ++	u_int v;
 + 
 + 	/* sanity check */
 + 	if (!ph || !ns) return -1;
 +@@ -141,6 +143,12 @@
 + 		if (!live_pcap) return -1;
 + 		if (pcap_setnonblock(live_pcap, 1, buf) < 0) {
 + 			screen_status("%s: %s", ph->name, buf);
 ++			show_dump_close();
 ++			return -1;
 ++		}
 ++		v = 1;
 ++		if (ioctl(pcap_fileno(live_pcap), BIOCIMMEDIATE, &v) < 0) {
 ++			screen_status("%s: %s", ph->name, strerror(errno));
 + 			show_dump_close();
 + 			return -1;
 + 		}
 diff -urN trafshow.save/files/patch-trafshow.c trafshow/files/patch-trafshow.c
 --- trafshow.save/files/patch-trafshow.c	Mon Nov  7 22:33:44 2005
 +++ trafshow/files/patch-trafshow.c	Wed Feb  1 18:08:02 2006
 @@ -1,11 +1,32 @@
 ---- trafshow.c.orig	Mon Jul 12 07:20:41 2004
 -+++ trafshow.c	Mon Nov  7 22:25:56 2005
 -@@ -305,7 +305,7 @@
 - 			fprintf(stderr, "%s: %s\n", dp->name, buf);
 - 			err++;
 +--- trafshow.c.orig	Sun Jan  8 08:05:29 2006
 ++++ trafshow.c	Wed Feb  1 18:07:33 2006
 +@@ -20,6 +20,7 @@
 + #endif
 + #include <sys/types.h>
 + #include <sys/socket.h>
 ++#include <sys/ioctl.h>
 + #include <stdio.h>
 + #include <stdlib.h>
 + #include <signal.h>
 +@@ -281,6 +282,7 @@
 + 	pcap_t *pd;
 + 	PCAP_HANDLER *ph, *ph_prev = 0;
 + 	char buf[256];
 ++	u_int v;
 + 
 + 	if (!ph_list) return -1;
 + 
 +@@ -307,6 +309,13 @@
   		}
 --		if (pcap_setnonblock(pd, 1, buf) < 0) {
 -+		if (pcap_setnonblock(pd, 0, buf) < 0) {
 + 		if (pcap_setnonblock(pd, 1, buf) < 0) {
   			fprintf(stderr, "%s: %s\n", dp->name, buf);
 ++			pcap_close(pd);
 ++			err++;
 ++			continue;
 ++		}
 ++		v = 1;
 ++		if (ioctl(pcap_fileno(pd), BIOCIMMEDIATE, &v) < 0) {
 ++			fprintf(stderr, "%s: %s\n", dp->name, strerror(errno));
   			pcap_close(pd);
   			err++;
 + 			continue;
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602011717.k11HHEui060531>