Package: arpwatch
Version: 2.1a15-1.1
Severity: normal
Tags: patch

Hi,

I'm wondering whether the restart option should also apply after the
polling loop returns because of an error...

The scenario I'm trying to fix is that in which the watched interface
goes down (hopefully temporarily). Currently this causes arpwatch to
start busy-looping (strictly speaking, libpcap; see #520393). Fixing
libpcap to report an error in this case causes arpwatch to abort, even
if restarts have been requested. The attached patch causes arpwatch to
restart, which will eventually allow it to continue watching the
interface if it comes back up.

Regards,

Stephen

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (200, 'unstable'), (1, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages arpwatch depends on:
ii  adduser                       3.111      add and remove users and groups
ii  debianutils                   3.2.1      Miscellaneous utilities specific t
ii  libc6                         2.9-25     GNU C Library: Shared libraries

arpwatch recommends no packages.

arpwatch suggests no packages.

-- no debconf information
--- arpwatch-2.1a15.old/arpwatch.c      2009-09-01 14:01:03.000000000 +0200
+++ arpwatch-2.1a15/arpwatch.c  2009-10-17 16:55:11.000000000 +0200
@@ -478,7 +478,13 @@
        }
        if (status < 0) {
                syslog(LOG_ERR, "pcap_loop: %s", pcap_geterr(pd));
-               exit(1);
+               if (!restart) {
+                       exit(1);
+               } else {
+                       pcap_close(pd);
+                       sleep(restart);
+                       goto label_restart;
+               }
        }
        pcap_close(pd);
        if (!dump())

Reply via email to