From daa3e5386fd0ce4ee8c46f117e9509a0ac9c7702 Mon Sep 17 00:00:00 2001 From: rui Date: Sat, 12 May 2007 21:36:28 +0000 Subject: [PATCH] update bing to 1.0.5 - fixes a memory alignment on sparc64 (from pedro@) - ok steven@ --- net/bing/Makefile | 7 ++-- net/bing/distinfo | 10 +++--- net/bing/patches/patch-Makefile | 8 ++--- net/bing/patches/patch-bing_c | 59 +++++++++++++++++++++++---------- 4 files changed, 53 insertions(+), 31 deletions(-) diff --git a/net/bing/Makefile b/net/bing/Makefile index 1662ab669f0..9e111c92b6c 100644 --- a/net/bing/Makefile +++ b/net/bing/Makefile @@ -1,11 +1,10 @@ -# $OpenBSD: Makefile,v 1.17 2006/10/09 09:42:24 espie Exp $ +# $OpenBSD: Makefile,v 1.18 2007/05/12 21:36:28 rui Exp $ COMMENT= "point-to-point bandwidth measurement tool" -DISTNAME= bing-1.0.4 -PKGNAME= ${DISTNAME}p2 +DISTNAME= bing-1.0.5 CATEGORIES= net -MASTER_SITES= ftp://ftp.lip6.fr/pub/networking/ +MASTER_SITES= ftp://ftp.ens.fr/pub/unix/syst/ HOMEPAGE= http://www.fibrespeed.net/~mbabcock/mirrors/bing/bing.html diff --git a/net/bing/distinfo b/net/bing/distinfo index b6666a51348..023f7fce97a 100644 --- a/net/bing/distinfo +++ b/net/bing/distinfo @@ -1,5 +1,5 @@ -MD5 (bing-1.0.4.tar.gz) = M1M8E3y+MZMezlex5bnVUg== -RMD160 (bing-1.0.4.tar.gz) = 5DTqhwVncjSsKJ/58qcs3/u4mqY= -SHA1 (bing-1.0.4.tar.gz) = IZVFFvS3KJWte+ltMgWBUQoYazM= -SHA256 (bing-1.0.4.tar.gz) = YUR2L9vDriQe+1zrpTjICpEa327yNumS2uh6OU3xjHM= -SIZE (bing-1.0.4.tar.gz) = 27069 +MD5 (bing-1.0.5.tar.gz) = b/fBwvNYaTXtacvi3rT5Ww== +RMD160 (bing-1.0.5.tar.gz) = pmi4R+hC7JQDvSw/r8Zv7H4JOw4= +SHA1 (bing-1.0.5.tar.gz) = OPRSHsKmWXhiFvkPXBBcXwmiMg0= +SHA256 (bing-1.0.5.tar.gz) = zrgFkU1FhJcPbWzTIiav5phSQJVxCZ8F2Zmh1Hv5bdw= +SIZE (bing-1.0.5.tar.gz) = 28141 diff --git a/net/bing/patches/patch-Makefile b/net/bing/patches/patch-Makefile index 3436afff09c..dd22146fa53 100644 --- a/net/bing/patches/patch-Makefile +++ b/net/bing/patches/patch-Makefile @@ -1,8 +1,8 @@ -$OpenBSD: patch-Makefile,v 1.2 2006/10/09 09:42:24 espie Exp $ ---- Makefile.orig Fri Jul 21 02:03:30 1995 -+++ Makefile Mon Oct 9 11:38:37 2006 +$OpenBSD: patch-Makefile,v 1.3 2007/05/12 21:36:28 rui Exp $ +--- Makefile.orig Fri May 11 20:06:31 2007 ++++ Makefile Fri May 11 20:07:51 2007 @@ -2,7 +2,7 @@ - # Makefile,v 1.4 1995/07/21 00:03:30 pb Exp + # $Id: patch-Makefile,v 1.3 2007/05/12 21:36:28 rui Exp $ # MANDIR=/usr/local/man -BINDIR=/usr/local/bin diff --git a/net/bing/patches/patch-bing_c b/net/bing/patches/patch-bing_c index cbdbe8d8cfb..97ccd157770 100644 --- a/net/bing/patches/patch-bing_c +++ b/net/bing/patches/patch-bing_c @@ -1,7 +1,30 @@ -$OpenBSD: patch-bing_c,v 1.1 2002/09/17 09:06:23 pvalchev Exp $ ---- bing.c.orig Thu Jul 20 17:45:32 1995 -+++ bing.c Tue Sep 17 02:56:49 2002 -@@ -1228,17 +1228,30 @@ int main(argc, argv) +$OpenBSD: patch-bing_c,v 1.2 2007/05/12 21:36:28 rui Exp $ +--- bing.c.orig Fri Jan 19 18:28:53 2001 ++++ bing.c Sat May 12 14:52:52 2007 +@@ -755,7 +755,7 @@ int pr_pack(buf, cc, from) + static int old_rrlen; + static char old_rr[MAX_IPOPTLEN]; + struct ip *ip; +- struct timeval tv, *tp; ++ struct timeval tv, tv2, *tp; + double triptime; + int hlen, dupflag; + +@@ -798,9 +798,12 @@ int pr_pack(buf, cc, from) + cc -= hlen; + icp = (struct icmp *)(buf + hlen); + if (icp->icmp_type == ICMP_ECHOREPLY) { ++ char *tmp; + if (icp->icmp_id != ident) + return -1; /* 'Twas not our ECHO */ +- tp = (struct timeval *)ICMP_TO_DATA(icp); ++ tmp = (char *)ICMP_TO_DATA(icp); ++ memcpy(&tv2, tmp, sizeof(tv2)); ++ tp = &tv2; + tvsub(&tv, tp); + triptime = tv_usval(&tv); + +@@ -1231,17 +1234,30 @@ int main(argc, argv) struct hoststats *hs1, *hs2; int ntrans, nloops, bits; int i; @@ -17,24 +40,24 @@ $OpenBSD: patch-bing_c,v 1.1 2002/09/17 09:06:23 pvalchev Exp $ hs1 = &hoststats1; hs2 = &hoststats2; -+ if (!(proto = getprotobyname("icmp"))) { -+ (void)fprintf(stderr, "bing: unknown protocol icmp.\n"); -+ exit(1); -+ } -+ if ((s = socket(AF_INET, SOCK_RAW, proto->p_proto)) < 0) { -+ perror("bing: socket"); -+ exit(1); -+ } -+ /* Revoke privileges */ -+ if (seteuid(getuid()) == -1 || setuid(getuid()) == -1) { -+ err(1, "unable to drop permissions"); -+ exit(1); -+ } ++ if (!(proto = getprotobyname("icmp"))) { ++ (void)fprintf(stderr, "bing: unknown protocol icmp.\n"); ++ exit(1); ++ } ++ if ((s = socket(AF_INET, SOCK_RAW, proto->p_proto)) < 0) { ++ perror("bing: socket"); ++ exit(1); ++ } ++ /* Revoke privileges */ ++ if (seteuid(getuid()) == -1 || setuid(getuid()) == -1) { ++ err(1, "unable to drop permissions"); ++ exit(1); ++ } + preload = 0; datap = &outpack[8 + sizeof(struct timeval)]; while ((ch = getopt(argc, argv, "I:LRc:dDe:fh:i:l:nPp:rS:s:t:vVwz")) != EOF) -@@ -1395,15 +1408,6 @@ int main(argc, argv) +@@ -1398,15 +1414,6 @@ int main(argc, argv) ident = getpid() & 0xFFFF;