update to mtr-0.87

This commit is contained in:
sthen 2016-10-12 11:39:27 +00:00
parent 1e10293005
commit 533cf1a50a
5 changed files with 103 additions and 10 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.59 2016/04/06 21:52:03 sthen Exp $
# $OpenBSD: Makefile,v 1.60 2016/10/12 11:39:27 sthen Exp $
COMMENT= Matt's traceroute - network diagnostic tool#'
DISTNAME= mtr-0.86
REVISION= 1
DISTNAME= mtr-0.87
CATEGORIES= net
MAINTAINER= Stuart Henderson <sthen@openbsd.org>
@ -13,7 +12,7 @@ HOMEPAGE= http://www.bitwizard.nl/mtr/
# GPLv2+
PERMIT_PACKAGE_CDROM= yes
WANTLIB= lib/libbind/bind c m termcap
WANTLIB= lib/libbind/bind c m ncurses
LIB_DEPENDS= net/libbind
MASTER_SITES= ftp://ftp.bitwizard.nl/mtr/
@ -37,7 +36,14 @@ CONFIGURE_ARGS+= --without-glib \
--without-gtk
.endif
# need to regen for now, upstream built their automake files without the gtk aclocal files
AUTOCONF_VERSION= 2.69
AUTOMAKE_VERSION= 1.11
BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS} \
${MODGNU_AUTOMAKE_DEPENDS}
post-patch:
cd ${WRKSRC}; AUTOCONF_VERSION=${AUTOCONF_VERSION} AUTOMAKE_VERSION=${AUTOMAKE_VERSION} ./bootstrap.sh
touch ${WRKSRC}/config.h.in
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (mtr-0.86.tar.gz) = xdlIkgtkHMNfizgPw1bd/gfM5qnGR0r+JC/FgRPyjAY=
SIZE (mtr-0.86.tar.gz) = 185374
SHA256 (mtr-0.87.tar.gz) = GTlHxh0jsVTI3ANnfpDo/ZEvjxhWerds5hm3hWxK8Z8=
SIZE (mtr-0.87.tar.gz) = 184645

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-gtk_c,v 1.4 2013/11/19 16:39:26 sthen Exp $
$OpenBSD: patch-gtk_c,v 1.5 2016/10/12 11:39:27 sthen Exp $
Fix 64-bit issue.
Fix with newer glib.
--- gtk.c.orig Mon Apr 29 14:22:05 2013
+++ gtk.c Sun Nov 17 16:44:55 2013
--- gtk.c.orig Mon Aug 1 14:07:58 2016
+++ gtk.c Wed Aug 3 14:20:06 2016
@@ -21,6 +21,7 @@
#include <stdio.h>
@ -13,7 +13,7 @@ Fix with newer glib.
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -69,6 +70,7 @@ void gtk_do_init(int *argc, char ***argv)
@@ -72,6 +73,7 @@ void gtk_do_init(int *argc, char ***argv)
static int done = 0;
if(!done) {

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-mtr_c,v 1.1 2016/10/12 11:39:27 sthen Exp $
--- mtr.c.orig Wed Aug 3 14:20:21 2016
+++ mtr.c Wed Aug 3 14:21:15 2016
@@ -310,7 +310,9 @@ void parse_arg (int argc, char **argv)
{ "max-unknown", 1, NULL, 'U' },
{ "udp", 0, NULL, 'u' }, /* UDP (default is ICMP) */
{ "tcp", 0, NULL, 'T' }, /* TCP (default is ICMP) */
+#ifdef IPPROTO_SCTP
{ "sctp", 0, NULL, 'S' }, /* SCTP (default is ICMP) */
+#endif
{ "port", 1, NULL, 'P' }, /* target port number for TCP/SCTP/UDP */
{ "localport", 1, NULL, 'L' }, /* source port number for UDP */
{ "timeout", 1, NULL, 'Z' }, /* timeout for TCP sockets */
@@ -476,6 +478,7 @@ void parse_arg (int argc, char **argv)
}
mtrtype = IPPROTO_TCP;
break;
+#ifdef IPPROTO_SCTP
case 'S':
if (mtrtype != IPPROTO_ICMP) {
fprintf(stderr, "-u , -T and -S are mutually exclusive.\n");
@@ -485,6 +488,7 @@ void parse_arg (int argc, char **argv)
remoteport = 80;
}
mtrtype = IPPROTO_SCTP;
+#endif
case 'b':
show_ips = 1;
break;

View File

@ -0,0 +1,58 @@
$OpenBSD: patch-net_c,v 1.3 2016/10/12 11:39:27 sthen Exp $
--- net.c.orig Mon Aug 1 14:07:58 2016
+++ net.c Wed Oct 12 12:25:44 2016
@@ -428,6 +428,7 @@ void net_send_tcp(int index)
connect(s, (struct sockaddr *) &remote, len);
}
+#ifdef IPPROTO_SCTP
/* Attempt to connect to a SCTP port with a TTL */
void net_send_sctp(int index)
{
@@ -544,6 +545,7 @@ void net_send_sctp(int index)
connect(s, (struct sockaddr *) &remote, len);
}
+#endif
/* Attempt to find the host at a particular number of hops away */
void net_send_query(int index)
@@ -553,10 +555,12 @@ void net_send_query(int index)
return;
}
+#ifdef IPPROTO_SCTP
if (mtrtype == IPPROTO_SCTP) {
net_send_sctp(index);
return;
}
+#endif
/*ok char packet[sizeof(struct IPHeader) + sizeof(struct ICMPHeader)];*/
char packet[MAXPACKET];
@@ -872,7 +876,9 @@ void net_process_return(void)
struct ICMPHeader *header = NULL;
struct UDPHeader *udpheader = NULL;
struct TCPHeader *tcpheader = NULL;
+#ifdef IPPROTO_SCTP
struct SCTPHeader *sctpheader = NULL;
+#endif
struct timeval now;
ip_t * fromaddress = NULL;
int echoreplytype = 0, timeexceededtype = 0, unreachabletype = 0;
@@ -1046,6 +1052,7 @@ void net_process_return(void)
}
break;
+#ifdef IPPROTO_SCTP
case IPPROTO_SCTP:
if (header->type == timeexceededtype || header->type == unreachabletype) {
switch ( af ) {
@@ -1082,6 +1089,7 @@ void net_process_return(void)
sequence = ntohs(sctpheader->srcport);
}
break;
+#endif
}
if (sequence)
net_process_ping (sequence, mpls, (void *) fromaddress, now);