pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/hping * detection of endian in bytesex.h is not en...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d52d9ab32563
branches:  trunk
changeset: 554241:d52d9ab32563
user:      obache <obache%pkgsrc.org@localhost>
date:      Wed Feb 11 08:06:17 2009 +0000

description:
* detection of endian in bytesex.h is not enough, use result of byteorder.h.
* replace hard coded user and mode for hping-suid option with SPECIAL_PERMS.
* replace remaining of hard coded "man" with ${PKGMANDIR}.
* add DESTDIR support.
* merge patch-a{e,g}, both for same file.
* patch to replace __sun__ with __sun for portability, pkglint(1) said.
* also regen other patches with mkpatches(1).

diffstat:

 net/hping/Makefile         |   14 +++--
 net/hping/PLIST            |    8 +-
 net/hping/distinfo         |   33 ++++++------
 net/hping/options.mk       |    5 +-
 net/hping/patches/patch-aa |   18 +++---
 net/hping/patches/patch-ab |    8 +-
 net/hping/patches/patch-ac |    6 +-
 net/hping/patches/patch-ad |   15 ++++-
 net/hping/patches/patch-ae |  110 ++++++++++++++++++++++++++++++++++++++++++--
 net/hping/patches/patch-af |   16 +++---
 net/hping/patches/patch-ag |   83 ---------------------------------
 net/hping/patches/patch-ah |   12 ++--
 net/hping/patches/patch-ai |   12 ++--
 net/hping/patches/patch-aj |    8 +-
 net/hping/patches/patch-ak |   12 ++--
 net/hping/patches/patch-al |   10 ++--
 net/hping/patches/patch-am |   12 ++--
 net/hping/patches/patch-an |   27 ++++++----
 net/hping/patches/patch-ao |    8 +-
 net/hping/patches/patch-ap |   13 +++++
 net/hping/patches/patch-aq |   25 ++++++++++
 21 files changed, 263 insertions(+), 192 deletions(-)

diffs (truncated from 801 to 300 lines):

diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/Makefile
--- a/net/hping/Makefile        Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/Makefile        Wed Feb 11 08:06:17 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2007/01/07 09:14:02 rillig Exp $
+# $NetBSD: Makefile,v 1.10 2009/02/11 08:06:17 obache Exp $
 #
 
 DISTNAME=              hping2.0.0-rc3
@@ -10,9 +10,11 @@
 HOMEPAGE=              http://www.hping.org/
 COMMENT=               Command-line oriented TCP/IP packet assembler/analyzer
 
+PKG_DESTDIR_SUPPORT=   user-destdir
+
 WRKSRC=                        ${WRKDIR}/hping2-rc3
 HAS_CONFIGURE=         YES
-MANPATH=               ${PREFIX}/man
+MANPATH=               ${PREFIX}/${PKGMANDIR}
 CONFIGURE_ENV+=                MANPATH=${MANPATH:Q}
 
 INSTALLATION_DIRS=     ${PKGMANDIR}/man8 sbin
@@ -23,10 +25,10 @@
 .include "options.mk"
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/hping2 ${PREFIX}/sbin
-       ${LN} -s ../sbin/hping2 ${PREFIX}/sbin/hping
-       ${INSTALL_MAN} ${WRKSRC}/docs/hping2.8 ${PREFIX}/${PKGMANDIR}/man8
-       ${LN} -s ../../man/man8/hping2.8 ${PREFIX}/${PKGMANDIR}/man8/hping.8
+       ${INSTALL_PROGRAM} ${WRKSRC}/hping2 ${DESTDIR}${PREFIX}/sbin
+       ${LN} -s hping2 ${DESTDIR}${PREFIX}/sbin/hping
+       ${INSTALL_MAN} ${WRKSRC}/docs/hping2.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
+       ${LN} -s hping2.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/hping.8
 
 .include "../../net/libpcap/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/PLIST
--- a/net/hping/PLIST   Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/PLIST   Wed Feb 11 08:06:17 2009 +0000
@@ -1,5 +1,5 @@
-@comment $NetBSD: PLIST,v 1.1.1.1 2002/04/04 17:02:30 atatat Exp $
-sbin/hping2
+@comment $NetBSD: PLIST,v 1.2 2009/02/11 08:06:17 obache Exp $
+man/man8/hping.8
+man/man8/hping2.8
 sbin/hping
-man/man8/hping2.8
-man/man8/hping.8
+sbin/hping2
diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/distinfo
--- a/net/hping/distinfo        Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/distinfo        Wed Feb 11 08:06:17 2009 +0000
@@ -1,20 +1,21 @@
-$NetBSD: distinfo,v 1.7 2006/03/30 13:51:28 salo Exp $
+$NetBSD: distinfo,v 1.8 2009/02/11 08:06:17 obache Exp $
 
 SHA1 (hping2.0.0-rc3.tar.gz) = ec48293ca25e08155bf4b51ad6140b1be576a16f
 RMD160 (hping2.0.0-rc3.tar.gz) = 345c6b29e48c2f9aea6b8bafb68c258f9ff8b083
 Size (hping2.0.0-rc3.tar.gz) = 124573 bytes
-SHA1 (patch-aa) = 651a2dad60439e19a5815909ef6e857c9d6cde86
-SHA1 (patch-ab) = 062bc2405c76d0c550a4750c3ffb8def236dc06d
-SHA1 (patch-ac) = b39369c28ca8932f13d9500509b84e28a1db6058
-SHA1 (patch-ad) = 292d9807ca7af37a70d1901bd614c00662ae9a74
-SHA1 (patch-ae) = db7634c10680a8729ffdcace4fd7abb676140b5d
-SHA1 (patch-af) = 1099dc70a7053e6c7bead73445b3748d3798cfef
-SHA1 (patch-ag) = 60b3e784c18f0a1c5a84af401dbc59b9e81f9d3d
-SHA1 (patch-ah) = fe763d1f21f744b950f62ca062fbf8bd4a7e00f3
-SHA1 (patch-ai) = af2d948240101f264c1fb97eedd4417fd3bf8d6a
-SHA1 (patch-aj) = 8143a56a7fa28f7985b08d4dcf752153dc8d9edf
-SHA1 (patch-ak) = 1021be12c2ceb7b9a1b428dd9f928c28f1f0f8b7
-SHA1 (patch-al) = d27e28938e731952e8bceb642c3441a4741f0b3d
-SHA1 (patch-am) = 9f71209f239c34e9be54e34505cbbd0a5da92cb2
-SHA1 (patch-an) = 4b2a4b7b7b3b4a206d8cadf2ab62c703059b7d7d
-SHA1 (patch-ao) = 139cc79d5473c46b838a1f70d06595f598398f17
+SHA1 (patch-aa) = 6d0e1dc19c1573fb15e482620b04a1dcd9366f55
+SHA1 (patch-ab) = 9862f8d4c350f5f242c5315521ca46053a055d58
+SHA1 (patch-ac) = 9608992ff762b779faf4417c4f19df7bf7f54361
+SHA1 (patch-ad) = d90ed1c6bebe74903f5f0f78ca292c8494f28f8b
+SHA1 (patch-ae) = ad261bd6c3a86c6dafde85d4cd23ec46c3e49345
+SHA1 (patch-af) = 2809447092057013a4971843df7d7b7c7d860b62
+SHA1 (patch-ah) = f3599715ef150adbf435d4dee216dbd8cb90b52f
+SHA1 (patch-ai) = e52b3544e0fdee5531362acebe16de6f56a938e0
+SHA1 (patch-aj) = 83c49aa82ad0bd90b877a7c14f9c46fb02e48622
+SHA1 (patch-ak) = 75772bcb61ae10957084a542858bffcae680d841
+SHA1 (patch-al) = 0e924bc1ac062f2b3d2a73d3aee7c23790ce75c5
+SHA1 (patch-am) = 658ac214b36c3f60b33b5eb4d7f7cd8153bd27b5
+SHA1 (patch-an) = f660b165d5564149a5b57fa7b84e305af1fefc51
+SHA1 (patch-ao) = 52d30d71d91c33174de17dd1d0096c05e533504b
+SHA1 (patch-ap) = 369b03242eb513ba73d75e7102e7aa5491a13e2e
+SHA1 (patch-aq) = 548dd11def5085580ec118bb8ecff43df60a4140
diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/options.mk
--- a/net/hping/options.mk      Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/options.mk      Wed Feb 11 08:06:17 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1 2006/03/30 13:51:28 salo Exp $
+# $NetBSD: options.mk,v 1.2 2009/02/11 08:06:17 obache Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.hping
 PKG_SUPPORTED_OPTIONS= hping-suid
@@ -6,6 +6,5 @@
 .include "../../mk/bsd.options.mk"
 
 .if !empty(PKG_OPTIONS:Mhping-suid)
-BINOWN=                        root
-BINMODE=               4511
+SPECIAL_PERMS+=        sbin/hping2 ${SETUID_ROOT_PERMS}
 .endif
diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/patches/patch-aa
--- a/net/hping/patches/patch-aa        Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/patches/patch-aa        Wed Feb 11 08:06:17 2009 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.3 2006/03/30 13:51:29 salo Exp $
+$NetBSD: patch-aa,v 1.4 2009/02/11 08:06:17 obache Exp $
 
---- main.c.orig        2003-08-08 01:55:55.000000000 +0200
-+++ main.c     2005-11-05 21:45:04.000000000 +0100
-@@ -47,7 +47,8 @@
+--- main.c.orig        2003-08-07 23:55:55.000000000 +0000
++++ main.c
+@@ -47,7 +47,8 @@ unsigned int
        signlen,
        lsr_length = 0,
        ssr_length = 0,
@@ -12,7 +12,7 @@
  
  
  unsigned short int
-@@ -65,6 +66,7 @@
+@@ -65,6 +66,7 @@ int
        recv_pkt = 0,
        out_of_sequence_pkt = 0,
        sending_wait = DEFAULT_SENDINGWAIT,     /* see DEFAULT_SENDINGWAIT */
@@ -20,7 +20,7 @@
        opt_rawipmode   = FALSE,
        opt_icmpmode    = FALSE,
        opt_udpmode     = FALSE,
-@@ -98,6 +100,7 @@
+@@ -98,6 +100,7 @@ int
        opt_tcpexitcode = FALSE,
        opt_badcksum    = FALSE,
        opt_tr_keep_ttl = FALSE,
@@ -28,7 +28,7 @@
        opt_tcp_timestamp = FALSE,
        opt_tr_stop     = FALSE,
        opt_tr_no_rtt   = FALSE,
-@@ -179,6 +182,17 @@
+@@ -179,6 +182,17 @@ int main(int argc, char **argv)
        char setflags[1024] = {'\0'};
        int c, hdr_size;
  
@@ -46,7 +46,7 @@
        if (parse_options(argc, argv) == -1) {
                printf("hping2: missing host argument\n"
                        "Try `hping2 --help' for more information.\n");
-@@ -219,13 +233,6 @@
+@@ -219,13 +233,6 @@ int main(int argc, char **argv)
                        ifname, ifstraddr, h_if_mtu);
        }
  
@@ -60,7 +60,7 @@
        /* set SO_BROADCAST option */
        socket_broadcast(sockraw);
        /* set SO_IPHDRINCL option */
-@@ -355,6 +362,13 @@
+@@ -355,6 +362,13 @@ int main(int argc, char **argv)
                }
        }
  
diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/patches/patch-ab
--- a/net/hping/patches/patch-ab        Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/patches/patch-ab        Wed Feb 11 08:06:17 2009 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ab,v 1.2 2006/03/30 13:51:29 salo Exp $
+$NetBSD: patch-ab,v 1.3 2009/02/11 08:06:17 obache Exp $
 
---- Makefile.in.orig   2004-05-03 11:29:39.000000000 +0200
-+++ Makefile.in        2005-11-05 21:07:50.000000000 +0100
+--- Makefile.in.orig   2004-05-03 09:29:39.000000000 +0000
++++ Makefile.in
 @@ -6,14 +6,14 @@
  # $date: Sun Jul 25 17:56:15 MET DST 1999$ 
  # $rev: 3$ 
@@ -23,7 +23,7 @@
  INSTALL_MANPATH=@MANPATH@
  @PCAP@
  
-@@ -39,21 +39,17 @@
+@@ -39,21 +39,17 @@ ARSOBJ = ars.o apd.o split.o
  all: hping2
  
  libars.a: $(ARSOBJ)
diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/patches/patch-ac
--- a/net/hping/patches/patch-ac        Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/patches/patch-ac        Wed Feb 11 08:06:17 2009 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-ac,v 1.1 2005/07/13 14:18:22 drochner Exp $
+$NetBSD: patch-ac,v 1.2 2009/02/11 08:06:17 obache Exp $
 
---- configure.orig     2005-07-13 15:30:53.000000000 +0200
+--- configure.orig     2002-12-13 16:19:30.000000000 +0000
 +++ configure
-@@ -61,8 +61,8 @@ if [ "$CONFIGOSTYPE" = "LINUX" ]; then
+@@ -66,8 +66,8 @@ if [ "$CONFIGOSTYPE" = "LINUX" ]; then
        PCAP=""
        PCAP_INCLUDE=""
  else
diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/patches/patch-ad
--- a/net/hping/patches/patch-ad        Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/patches/patch-ad        Wed Feb 11 08:06:17 2009 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ad,v 1.3 2006/03/30 13:51:29 salo Exp $
+$NetBSD: patch-ad,v 1.4 2009/02/11 08:06:17 obache Exp $
 
---- libpcap_stuff.c.orig       2002-12-13 15:07:07.000000000 +0100
-+++ libpcap_stuff.c    2006-03-22 19:54:51.000000000 +0100
+--- libpcap_stuff.c.orig       2002-12-13 14:07:07.000000000 +0000
++++ libpcap_stuff.c
 @@ -16,8 +16,10 @@
  #include <string.h>
  #include <stdlib.h>
@@ -14,3 +14,12 @@
  
  #include "globals.h"
  
+@@ -35,7 +37,7 @@ int open_pcap()
+               printf("[open_pcap] pcap_open_live: %s\n", errbuf);
+               return -1;
+       }
+-#if (!defined OSTYPE_LINUX) && (!defined __sun__)
++#if (!defined OSTYPE_LINUX) && (!defined __sun)
+       /* Return the packets to userspace as fast as possible */
+       if (ioctl(pcap_fileno(pcapfp), BIOCIMMEDIATE, &on) == -1)
+               perror("[open_pcap] ioctl(... BIOCIMMEDIATE ...)");
diff -r 737e4ea82f75 -r d52d9ab32563 net/hping/patches/patch-ae
--- a/net/hping/patches/patch-ae        Wed Feb 11 07:46:15 2009 +0000
+++ b/net/hping/patches/patch-ae        Wed Feb 11 08:06:17 2009 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ae,v 1.2 2006/03/30 13:51:29 salo Exp $
+$NetBSD: patch-ae,v 1.3 2009/02/11 08:06:17 obache Exp $
 
---- getifname.c.orig   2004-05-03 10:55:53.000000000 +0200
-+++ getifname.c        2006-03-22 19:56:40.000000000 +0100
+--- getifname.c.orig   2004-05-03 08:55:53.000000000 +0000
++++ getifname.c
 @@ -17,7 +17,7 @@
  #include <unistd.h>           /* close */
  
@@ -11,16 +11,114 @@
  #include <stdlib.h>
  #include <ifaddrs.h>
  #include <net/route.h>
-@@ -28,7 +28,7 @@
+@@ -27,12 +27,12 @@
+ #include "globals.h"
  
  #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && \
-     !defined(__linux__) && !defined(__sun__) && !defined(__bsdi__) && \
+-    !defined(__linux__) && !defined(__sun__) && !defined(__bsdi__) && \
 -    !defined(__APPLE__)
++    !defined(__linux__) && !defined(__sun) && !defined(__bsdi__) && \
 +    !defined(__APPLE__) && !defined(__DragonFly__)
  #error Sorry, interface code not implemented.
  #endif
  
-@@ -175,7 +175,7 @@
+-#ifdef __sun__
++#ifdef __sun
+ #include <sys/sockio.h>
+ #include <net/route.h>
+ #include <net/if_dl.h>
+@@ -40,15 +40,16 @@
+ 
+ static int get_output_if(struct sockaddr_in *dest, struct sockaddr_in *ifip);
+ 
+-#if (defined OSTYPE_LINUX) || (defined __sun__)
++#if (defined OSTYPE_LINUX) || (defined __sun)
+ int get_if_name(void)
+ {
+       int fd;
+       struct ifconf   ifc;
+-      struct ifreq    ibuf[16],
+-                      ifr,
++      struct ifreq    ifr,
+                       *ifrp,
+                       *ifend;
++      char *ibuf;
++      int ibuflen;
+       struct sockaddr_in sa;
+       struct sockaddr_in output_if_addr;
+       int known_output_if = 0;
+@@ -72,21 +73,40 @@ int get_if_name(void)
+               return -1;
+       }
+ 
+-      memset(ibuf, 0, sizeof(struct ifreq)*16);
+-      ifc.ifc_len = sizeof ibuf;
++      ibuf = NULL;
++      ibuflen = 16 * sizeof(struct ifreq);
++      for (;;) {



Home | Main Index | Thread Index | Old Index