pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/arpwatch If the interface doesn't have an ipv4 add...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/04489569729d
branches:  trunk
changeset: 511478:04489569729d
user:      bouyer <bouyer%pkgsrc.org@localhost>
date:      Sat Apr 15 09:54:20 2006 +0000

description:
If the interface doesn't have an ipv4 address and we provided a network
via -n, use it instead of bailing out. Allows to run arpwatch on interface
without IP address.
Bump pkgrevision.

diffstat:

 net/arpwatch/Makefile         |   3 +-
 net/arpwatch/distinfo         |   4 +-
 net/arpwatch/patches/patch-ac |  49 +++++++++++++++++++++++++++++++++++++++---
 3 files changed, 49 insertions(+), 7 deletions(-)

diffs (100 lines):

diff -r a593d2b97f6c -r 04489569729d net/arpwatch/Makefile
--- a/net/arpwatch/Makefile     Sat Apr 15 09:41:09 2006 +0000
+++ b/net/arpwatch/Makefile     Sat Apr 15 09:54:20 2006 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.26 2005/12/29 06:21:57 jlam Exp $
+# $NetBSD: Makefile,v 1.27 2006/04/15 09:54:20 bouyer Exp $
 #
 
 DISTNAME=      arpwatch-2.1a13
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  ftp://ftp.ee.lbl.gov/
 
diff -r a593d2b97f6c -r 04489569729d net/arpwatch/distinfo
--- a/net/arpwatch/distinfo     Sat Apr 15 09:41:09 2006 +0000
+++ b/net/arpwatch/distinfo     Sat Apr 15 09:54:20 2006 +0000
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.9 2005/12/05 20:50:44 rillig Exp $
+$NetBSD: distinfo,v 1.10 2006/04/15 09:54:20 bouyer Exp $
 
 SHA1 (arpwatch-2.1a13.tar.gz) = 03d98e239405529f97b742f04d2a9b837b5da43a
 RMD160 (arpwatch-2.1a13.tar.gz) = 80b89d36d9c20e9d0ac272ba7b66494d2888a557
 Size (arpwatch-2.1a13.tar.gz) = 152779 bytes
 SHA1 (patch-aa) = 01d72e1342cdcf2c566a2c761743d4b71af5985c
 SHA1 (patch-ab) = 73fb4cca476b58c3456f4d418779ae9aecfcf885
-SHA1 (patch-ac) = 0f89214364e5007f9929ad5a4449d4b11bd7dffe
+SHA1 (patch-ac) = f6f139fb1413ac2c483f6c8ea965a9a7b4b9a268
 SHA1 (patch-ad) = 0292675b4b48656575ad4429c98e1187962a1bef
 SHA1 (patch-ae) = cb392c6bb2c10b261a759e7c7835dd959d34a047
diff -r a593d2b97f6c -r 04489569729d net/arpwatch/patches/patch-ac
--- a/net/arpwatch/patches/patch-ac     Sat Apr 15 09:41:09 2006 +0000
+++ b/net/arpwatch/patches/patch-ac     Sat Apr 15 09:54:20 2006 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ac,v 1.9 2005/12/05 20:50:44 rillig Exp $
+$NetBSD: patch-ac,v 1.10 2006/04/15 09:54:20 bouyer Exp $
 
---- arpwatch.c.orig    2005-10-25 12:53:57.000000000 +0200
-+++ arpwatch.c 2005-10-25 12:56:40.000000000 +0200
+--- arpwatch.c.orig    2004-01-22 23:18:20.000000000 +0100
++++ arpwatch.c 2006-04-12 12:36:25.000000000 +0200
 @@ -107,6 +107,8 @@
  
  char *prog;
@@ -11,6 +11,19 @@
  int can_checkpoint;
  int swapped;
  int nobogons;
+@@ -119,9 +121,9 @@
+       u_int32_t netmask;
+ };
+ 
+-static struct nets *nets;
+-static int nets_ind;
+-static int nets_size;
++static struct nets *nets = NULL;
++static int nets_ind = 0;
++static int nets_size = 0;
+ 
+ extern int optind;
+ extern int opterr;
 @@ -170,7 +172,7 @@
        interface = NULL;
        rfilename = NULL;
@@ -31,7 +44,35 @@
                case 'n':
                        if (!addnet(optarg))
                                usage();
-@@ -751,6 +757,6 @@
+@@ -223,9 +229,24 @@
+ 
+               /* Determine network and netmask */
+               if (pcap_lookupnet(interface, &net, &netmask, errbuf) < 0) {
+-                      (void)fprintf(stderr, "%s: bad interface %s: %s\n",
+-                          prog, interface, errbuf);
+-                      exit(1);
++                      /* use the first -n parameter if available */
++                      if (nets != NULL) {
++                              net = nets[0].net;
++                              netmask = nets[0].netmask;
++                              /*
++                               * use 2 separate printf, intoa() uses
++                               * a static buffer.
++                               */
++                              printf("%s %s: %s, using %s",
++                                  prog, interface, errbuf,
++                                  intoa(net));
++                              printf("/%s\n", intoa(netmask));
++                      } else {
++                              (void)fprintf(stderr,
++                                  "%s: bad interface %s: %s\n",
++                                  prog, interface, errbuf);
++                              exit(1);
++                      }
+               }
+ 
+               /* Drop into the background if not debugging */
+@@ -751,6 +772,6 @@
  
        (void)fprintf(stderr, "Version %s\n", version);
        (void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface]"



Home | Main Index | Thread Index | Old Index