Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Sep 2015 18:43:03 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r396336 - in head/net-mgmt/mtrace: . files
Message-ID:  <201509071843.t87Ih3Fx002947@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Mon Sep  7 18:43:02 2015
New Revision: 396336
URL: https://svnweb.freebsd.org/changeset/ports/396336

Log:
  - Do not override CFLAGS.
  - Fix warnings.
  - Add WWW: line to pkg-descr.
  - Take maintainership.

Modified:
  head/net-mgmt/mtrace/Makefile
  head/net-mgmt/mtrace/files/patch-Makefile
  head/net-mgmt/mtrace/files/patch-mtrace.c
  head/net-mgmt/mtrace/pkg-descr

Modified: head/net-mgmt/mtrace/Makefile
==============================================================================
--- head/net-mgmt/mtrace/Makefile	Mon Sep  7 18:24:38 2015	(r396335)
+++ head/net-mgmt/mtrace/Makefile	Mon Sep  7 18:43:02 2015	(r396336)
@@ -3,15 +3,15 @@
 
 PORTNAME=	mtrace
 PORTVERSION=	5.2
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	SF
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	hrs@FreeBSD.org
 COMMENT=	Multicast traceroute program for IPv4
 
-PLIST_FILES=	sbin/mtrace man/man8/mtrace.8.gz
-
 ALL_TARGET=	mtrace
+PLIST_FILES=	sbin/mtrace man/man8/mtrace.8.gz
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/mtrace ${STAGEDIR}${PREFIX}/sbin

Modified: head/net-mgmt/mtrace/files/patch-Makefile
==============================================================================
--- head/net-mgmt/mtrace/files/patch-Makefile	Mon Sep  7 18:24:38 2015	(r396335)
+++ head/net-mgmt/mtrace/files/patch-Makefile	Mon Sep  7 18:43:02 2015	(r396336)
@@ -1,10 +1,12 @@
---- Makefile.orig	Thu Sep 28 22:57:58 2006
-+++ Makefile	Thu Sep 28 22:58:46 2006
-@@ -9,6 +9,7 @@
+--- Makefile.orig	1998-12-04 04:48:14 UTC
++++ Makefile
+@@ -8,7 +8,8 @@
+ #
  #MCAST_INCLUDE=	-I/sys
  #
- CFLAGS=		-O ${MCAST_INCLUDE} 	## SunOS, OSF1, FreeBSD, IRIX
-+CFLAGS+=	-O2 -fno-strict-aliasing -Dlog=logit
+-CFLAGS=		-O ${MCAST_INCLUDE} 	## SunOS, OSF1, FreeBSD, IRIX
++CFLAGS+=	-Dlog=logit
++#CFLAGS=		-O ${MCAST_INCLUDE} 	## SunOS, OSF1, FreeBSD, IRIX
  #CFLAGS=		-O ${MCAST_INCLUDE} -DRAW_OUTPUT_IS_RAW ## OpenBSD
  #CFLAGS=		-O ${MCAST_INCLUDE} -D__BSD_SOURCE -DRAW_OUTPUT_IS_RAW -DRAW_INPUT_IS_RAW	## Linux
  #CFLAGS=		-O ${MCAST_INCLUDE} -DSYSV -DSUNOS5	## Solaris 2.x

Modified: head/net-mgmt/mtrace/files/patch-mtrace.c
==============================================================================
--- head/net-mgmt/mtrace/files/patch-mtrace.c	Mon Sep  7 18:24:38 2015	(r396335)
+++ head/net-mgmt/mtrace/files/patch-mtrace.c	Mon Sep  7 18:43:02 2015	(r396336)
@@ -1,14 +1,68 @@
---- mtrace.c.orig	Thu Sep 28 22:58:53 2006
-+++ mtrace.c	Thu Sep 28 23:00:11 2006
-@@ -1486,6 +1486,7 @@
+--- mtrace.c.orig	1998-12-04 04:48:19 UTC
++++ mtrace.c
+@@ -147,8 +147,9 @@ static char rcsid[] =
+ #ifdef SUNOS5
+ #include <sys/systeminfo.h>
+ #endif
++#include <inttypes.h>
++typedef uint32_t	u_int32;
+ 
+-typedef unsigned int u_int32;	/* XXX */
+ #include "mtrace.h"
+ 
+ #define DEFAULT_TIMEOUT	3	/* How long to wait before retrying requests */
+@@ -283,7 +284,7 @@ extern char *		sys_errlist[];
+ #endif
+ 
+ #define RECV_BUF_SIZE 8192
+-char	*send_buf, *recv_buf;
++u_char	*send_buf, *recv_buf;
+ int	igmp_socket;
+ u_int32	allrtrs_group;
+ char	router_alert[4];	     	/* Router Alert IP Option	    */
+@@ -309,7 +310,7 @@ int ip_addlen = 0;		     	/* Workaround 
+ #endif
+ 
+ typedef int (*callback_t) __P((int, u_char *, int, struct igmp *, int,
+-			struct sockaddr *, int *, struct timeval *));
++			struct sockaddr *, socklen_t *, struct timeval *));
+ 
+ void			init_igmp __P((void));
+ void			send_igmp __P((u_int32 src, u_int32 dst, int type,
+@@ -380,10 +381,10 @@ init_igmp()
+ {
+     struct ip *ip;
+ 
+-    recv_buf = (char *)malloc(RECV_BUF_SIZE);
++    recv_buf = (u_char *)malloc(RECV_BUF_SIZE);
+     if (recv_buf == 0)
+ 	log(LOG_ERR, 0, "Out of memory allocating recv_buf!");
+-    send_buf = (char *)malloc(RECV_BUF_SIZE);
++    send_buf = (u_char *)malloc(RECV_BUF_SIZE);
+     if (send_buf == 0)
+ 	log(LOG_ERR, 0, "Out of memory allocating send_buf!");
+ 
+@@ -1196,7 +1197,8 @@ send_recv(dst, type, code, tries, save, 
+     u_int32 local, group;
+     int ipdatalen, iphdrlen, igmpdatalen;
+     int datalen;
+-    int count, recvlen, socklen = sizeof(recvaddr);
++    int count, recvlen;
++    socklen_t socklen = sizeof(recvaddr);
+     int len;
+     int i;
+ 
+@@ -1486,7 +1488,8 @@ passive_mode()
      struct sockaddr_in recvaddr;
      struct tm *now;
      char timebuf[32];
+-    int socklen;
 +    time_t tr_sec;
-     int socklen;
++    socklen_t socklen;
      int ipdatalen, iphdrlen, igmpdatalen;
      int len, recvlen;
-@@ -1593,7 +1594,8 @@
+     int qid;
+@@ -1593,7 +1596,8 @@ passive_mode()
  	    }
  	}
  
@@ -18,3 +72,119 @@
  	strftime(timebuf, sizeof(timebuf) - 1, "%b %e %k:%M:%S", now);
  	printf("Mtrace %s at %s",
  		len == 0 ? "query" :
+@@ -1972,11 +1976,12 @@ stat_line(r, s, have_next, rst)
+ 	break;
+ 
+       case NEITHER:
+-	if (ghave != NEITHER)
++	if (ghave != NEITHER) {
+ 	    if (tunstats)
+ 		printf("                         ");
+ 	    else
+ 		printf("           ");
++	}
+ 
+ 	break;
+     }
+@@ -2027,17 +2032,21 @@ stat_line(r, s, have_next, rst)
+ 
+ 
+     if (debug > 2) {
+-	printf("\t\t\t\tv_in: %ld ", ntohl(s->tr_vifin));
+-	printf("v_out: %ld ", ntohl(s->tr_vifout));
+-	printf("pkts: %ld\n", ntohl(s->tr_pktcnt));
+-	printf("\t\t\t\tv_in: %ld ", ntohl(r->tr_vifin));
+-	printf("v_out: %ld ", ntohl(r->tr_vifout));
+-	printf("pkts: %ld\n", ntohl(r->tr_pktcnt));
+-	printf("\t\t\t\tv_in: %ld ",ntohl(s->tr_vifin)-ntohl(r->tr_vifin));
+-	printf("v_out: %ld ", ntohl(s->tr_vifout) - ntohl(r->tr_vifout));
+-	printf("pkts: %ld ", ntohl(s->tr_pktcnt) - ntohl(r->tr_pktcnt));
++	printf("\t\t\t\tv_in: %jd ", (uintmax_t)ntohl(s->tr_vifin));
++	printf("v_out: %jd ", (uintmax_t)ntohl(s->tr_vifout));
++	printf("pkts: %jd\n", (uintmax_t)ntohl(s->tr_pktcnt));
++	printf("\t\t\t\tv_in: %jd ", (uintmax_t)ntohl(r->tr_vifin));
++	printf("v_out: %jd ", (uintmax_t)ntohl(r->tr_vifout));
++	printf("pkts: %jd\n", (uintmax_t)ntohl(r->tr_pktcnt));
++	printf("\t\t\t\tv_in: %jd ",
++	    (uintmax_t)(ntohl(s->tr_vifin)-ntohl(r->tr_vifin)));
++	printf("v_out: %jd ",
++	    (uintmax_t)(ntohl(s->tr_vifout) - ntohl(r->tr_vifout)));
++	printf("pkts: %jd ",
++	    (uintmax_t)(ntohl(s->tr_pktcnt) - ntohl(r->tr_pktcnt)));
+ 	printf("time: %d\n", timediff);
+-	printf("\t\t\t\treset: %x hoptime: %lx\n", *rst, ntohl(s->tr_qarr));
++	printf("\t\t\t\treset: %x hoptime: %lx\n", *rst,
++	    (u_long)ntohl(s->tr_qarr));
+     }
+ }
+ 
+@@ -2148,8 +2157,10 @@ fixup_stats(base, prev, new, bugs)
+ 	if (debug > 2) {
+     	    printf("\t\tip=%s, r=%d, res=%d\n", inet_fmt(b->tr_inaddr, s1), *r, res);
+ 	    if (res)
+-		printf("\t\tbase=%ld, prev=%ld, new=%ld\n", ntohl(b->tr_pktcnt),
+-			    ntohl(p->tr_pktcnt), ntohl(n->tr_pktcnt));
++		printf("\t\tbase=%jd, prev=%jd, new=%jd\n",
++		    (uintmax_t)ntohl(b->tr_pktcnt),
++			    (uintmax_t)ntohl(p->tr_pktcnt),
++		    (uintmax_t)ntohl(n->tr_pktcnt));
+ 	}
+ 	if (*r & BUG_RESET) {
+ 	    if (res || (*r & BUG_RESET2X)) {
+@@ -2286,16 +2297,20 @@ print_stats(base, prev, new, bugs, names
+ 	printf("     v     ^\n");
+     }
+     if (debug > 2) {
+-	printf("\t\t\t\tv_in: %ld ", ntohl(n->tr_vifin));
+-	printf("v_out: %ld ", ntohl(n->tr_vifout));
+-	printf("pkts: %ld\n", ntohl(n->tr_pktcnt));
+-	printf("\t\t\t\tv_in: %ld ", ntohl(b->tr_vifin));
+-	printf("v_out: %ld ", ntohl(b->tr_vifout));
+-	printf("pkts: %ld\n", ntohl(b->tr_pktcnt));
+-	printf("\t\t\t\tv_in: %ld ", ntohl(n->tr_vifin) - ntohl(b->tr_vifin));
+-	printf("v_out: %ld ", ntohl(n->tr_vifout) - ntohl(b->tr_vifout));
+-	printf("pkts: %ld\n", ntohl(n->tr_pktcnt) - ntohl(b->tr_pktcnt));
+-	printf("\t\t\t\treset: %x hoptime: %lx\n", *r, ntohl(n->tr_qarr));
++	printf("\t\t\t\tv_in: %jd ", (uintmax_t)ntohl(n->tr_vifin));
++	printf("v_out: %jd ", (uintmax_t)ntohl(n->tr_vifout));
++	printf("pkts: %jd\n", (uintmax_t)ntohl(n->tr_pktcnt));
++	printf("\t\t\t\tv_in: %jd ", (uintmax_t)ntohl(b->tr_vifin));
++	printf("v_out: %jd ", (uintmax_t)ntohl(b->tr_vifout));
++	printf("pkts: %jd\n", (uintmax_t)ntohl(b->tr_pktcnt));
++	printf("\t\t\t\tv_in: %jd ",
++	    (uintmax_t)(ntohl(n->tr_vifin) - ntohl(b->tr_vifin)));
++	printf("v_out: %jd ",
++	    (uintmax_t)(ntohl(n->tr_vifout) - ntohl(b->tr_vifout)));
++	printf("pkts: %jd\n",
++	    (uintmax_t)(ntohl(n->tr_pktcnt) - ntohl(b->tr_pktcnt)));
++	printf("\t\t\t\treset: %x hoptime: %lx\n", *r,
++	    (u_long)ntohl(n->tr_qarr));
+     }
+ 
+     while (TRUE) {
+@@ -2386,7 +2401,7 @@ char *argv[];
+ {
+     int udp;
+     struct sockaddr_in addr;
+-    int addrlen = sizeof(addr);
++    socklen_t addrlen = sizeof(addr);
+     int recvlen;
+     struct timeval tv;
+     struct resp_buf *prev, *new;
+@@ -2957,7 +2972,7 @@ continuehop:
+ 
+     if (base.rtime == 0) {
+ 	printf("Timed out receiving responses\n");
+-	if (IN_MULTICAST(ntohl(tdst)))
++	if (IN_MULTICAST(ntohl(tdst))) {
+ 	  if (tdst == query_cast)
+ 	    printf("Perhaps no local router has a route for source %s\n",
+ 		   inet_fmt(qsrc, s1));
+@@ -2967,6 +2982,7 @@ or no router local to it has a route for
+ or multicast at ttl %d doesn't reach its last-hop router for that source\n",
+ 		   inet_fmt(qdst, s2), inet_fmt(qgrp, s3), inet_fmt(qsrc, s1),
+ 		   qttl ? qttl : MULTICAST_TTL1);
++	}
+ 	exit(1);
+     }
+ 

Modified: head/net-mgmt/mtrace/pkg-descr
==============================================================================
--- head/net-mgmt/mtrace/pkg-descr	Mon Sep  7 18:24:38 2015	(r396335)
+++ head/net-mgmt/mtrace/pkg-descr	Mon Sep  7 18:43:02 2015	(r396336)
@@ -1,2 +1,4 @@
 mtrace is a program to trace the routes taken by IPv4 multicast
 traffic flows.
+
+WWW: http://sourceforge.net/projects/mtrace/



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