diff --git a/.cvsignore b/.cvsignore index ebe855c..55d89c2 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ arpwatch-2.1a15.tar.gz -ethercodes-20070613.dat +ethercodes-20070809.dat diff --git a/arpwatch-2.1a15-bogon.patch b/arpwatch-2.1a15-bogon.patch new file mode 100644 index 0000000..784deb0 --- /dev/null +++ b/arpwatch-2.1a15-bogon.patch @@ -0,0 +1,20 @@ +--- arpwatch-2.1a15/arpwatch.c.bogon 2007-08-09 13:53:47.000000000 +0200 ++++ arpwatch-2.1a15/arpwatch.c 2007-08-09 13:58:17.000000000 +0200 +@@ -730,11 +730,12 @@ addnet(register const char *str) + + /* XXX hack */ + n = ntohl(inet_addr(tstr)); +- while ((n & 0xff000000) == 0) { +- n <<= 8; +- if (n == 0) +- return (0); +- } ++ if (n || width != 32) ++ while ((n & 0xff000000) == 0) { ++ n <<= 8; ++ if (n == 0) ++ return (0); ++ } + n = htonl(n); + + if (width != 0) { diff --git a/arpwatch.init b/arpwatch.init index 5b36b15..8ea76ce 100644 --- a/arpwatch.init +++ b/arpwatch.init @@ -1,10 +1,21 @@ -#! /bin/sh +#!/bin/bash # # chkconfig: - 55 45 # description: The arpwatch daemon attempts to keep track of ethernet/ip \ # address pairings. # processname: arpwatch +### BEGIN INIT INFO +# Provides: arpwatch +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $network $local_fs $remote_fs +# Should-Start: $syslog $named +# Should-Stop: $syslog $named +# Short-Description: start and stop arpwatch +# Description: The arpwatch daemon attempts to keep track of ethernet/ip +# address pairings. +### END INIT INFO + # Source function library. . /etc/rc.d/init.d/functions @@ -15,33 +26,32 @@ if [ -f /etc/sysconfig/arpwatch ];then . /etc/sysconfig/arpwatch fi -RETVAL=0 -prog="arpwatch" +prog=arpwatch +lockfile=/var/lock/subsys/$prog start () { # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 1 + status $prog > /dev/null && return 0 + echo -n $"Starting $prog: " - daemon arpwatch $OPTIONS + daemon $prog $OPTIONS RETVAL=$? echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/arpwatch + [ $RETVAL -eq 0 ] && touch $lockfile + return $RETVAL } + stop () { echo -n $"Stopping $prog: " - killproc arpwatch + killproc $prog RETVAL=$? echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/arpwatch + [ $RETVAL -eq 0 ] && rm -f $lockfile + return $RETVAL } -restart () { - stop - start -} - - # See how we were called. case "$1" in start) @@ -51,18 +61,22 @@ case "$1" in stop ;; status) - status arpwatch - RETVAL=$? + status $prog ;; - restart|reload) - restart + restart|force-reload) + stop + start ;; - condrestart) - [ -f /var/lock/subsys/arpwatch ] && restart || : + try-restart|condrestart) + if status $prog > /dev/null; then + stop + start + fi + ;; + reload) + exit 3 ;; *) - echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" - RETVAL=3 + echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" + exit 2 esac - -exit $RETVAL diff --git a/arpwatch.spec b/arpwatch.spec index 5e5a2aa..5400a60 100644 --- a/arpwatch.spec +++ b/arpwatch.spec @@ -3,10 +3,10 @@ Name: arpwatch Epoch: 14 Version: 2.1a15 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Network monitoring tools for tracking IP addresses on a network Group: Applications/System -License: BSD +License: BSD with advertising URL: http://ee.lbl.gov/ Requires(pre): shadow-utils Requires(post): /sbin/chkconfig @@ -19,7 +19,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source0: ftp://ftp.ee.lbl.gov/arpwatch-%{version}.tar.gz Source1: arpwatch.init Source2: arpwatch.sysconfig -Source3: ethercodes-20070613.dat +Source3: ethercodes-20070809.dat Patch1: arpwatch-2.1a4-fhs.patch Patch2: arpwatch-2.1a10-man.patch Patch3: arpwatch-drop.patch @@ -28,6 +28,7 @@ Patch5: arpwatch-addr.patch Patch6: arpwatch-dir-man.patch Patch7: arpwatch-scripts.patch Patch8: arpwatch-2.1a15-nolocalpcap.patch +Patch9: arpwatch-2.1a15-bogon.patch %description The arpwatch package contains arpwatch and arpsnmp. Arpwatch and @@ -50,6 +51,7 @@ network. %patch6 -p1 -b .dirman %patch7 -p1 -b .scripts %patch8 -p1 -b .nolocalpcap +%patch9 -p1 -b .bogon %build %configure @@ -139,6 +141,12 @@ fi %verify(not md5 size mtime) %config %{_vararpwatch}/ethercodes.dat %changelog +* Thu Aug 09 2007 Miroslav Lichvar 14:2.1a15-6 +- improve init script (#246869) +- allow -n 0/32 to disable reporting bogons from 0.0.0.0 (#244606) +- update license tag +- update ethercodes.dat + * Wed Jun 13 2007 Miroslav Lichvar 14:2.1a15-5 - update ethercodes.dat diff --git a/sources b/sources index 31fb373..a76e16a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ cebfeb99c4a7c2a6cee2564770415fe7 arpwatch-2.1a15.tar.gz -5801cd4a047f50a97c18da36b5fbc6fe ethercodes-20070613.dat +83fab2029fce5c50539f1c3eb548f799 ethercodes-20070809.dat