diff options
author | bouyer <bouyer@pkgsrc.org> | 2006-04-15 09:54:20 +0000 |
---|---|---|
committer | bouyer <bouyer@pkgsrc.org> | 2006-04-15 09:54:20 +0000 |
commit | e140d68ab4e9b8b5113eaecbc71bd80cc0b6835e (patch) | |
tree | b1037cd37cc31a331cf0c364aeb1a50de066ea53 /net/arpwatch | |
parent | 4c2a544f0f068dad9dd58d35299a7311e47dba81 (diff) | |
download | pkgsrc-e140d68ab4e9b8b5113eaecbc71bd80cc0b6835e.tar.gz |
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 (limited to 'net/arpwatch')
-rw-r--r-- | net/arpwatch/Makefile | 3 | ||||
-rw-r--r-- | net/arpwatch/distinfo | 4 | ||||
-rw-r--r-- | net/arpwatch/patches/patch-ac | 49 |
3 files changed, 49 insertions, 7 deletions
diff --git a/net/arpwatch/Makefile b/net/arpwatch/Makefile index 1ff2fa21d23..c49fea3c29e 100644 --- a/net/arpwatch/Makefile +++ b/net/arpwatch/Makefile @@ -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 --git a/net/arpwatch/distinfo b/net/arpwatch/distinfo index c1120e73696..d2e12ac0018 100644 --- a/net/arpwatch/distinfo +++ b/net/arpwatch/distinfo @@ -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 --git a/net/arpwatch/patches/patch-ac b/net/arpwatch/patches/patch-ac index 6c97420f552..0cf8be8b333 100644 --- a/net/arpwatch/patches/patch-ac +++ b/net/arpwatch/patches/patch-ac @@ -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 @@ $NetBSD: patch-ac,v 1.9 2005/12/05 20:50:44 rillig Exp $ 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 @@ $NetBSD: patch-ac,v 1.9 2005/12/05 20:50:44 rillig Exp $ 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]" |