~ubuntu-branches/ubuntu/precise/iproute/precise

« back to all changes in this revision

Viewing changes to debian/patches/ip_address_flush_loop.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Fabio M. Di Nitto
  • Date: 2006-11-14 15:18:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20061114151853-nd3k7f6d10e18r7m
Tags: 20061002-2ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## ip_address_flush_loop.dpatch by Alexander Wirt <formorer@debian.org>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: No description.
 
6
 
 
7
@DPATCH@
 
8
diff -urNad iproute-20060323~/ip/ipaddress.c iproute-20060323/ip/ipaddress.c
 
9
--- iproute-20060323~/ip/ipaddress.c    2006-09-08 17:02:03.000000000 +0200
 
10
+++ iproute-20060323/ip/ipaddress.c     2006-09-08 17:03:01.000000000 +0200
 
11
@@ -15,6 +15,7 @@
 
12
 #include <stdio.h>
 
13
 #include <stdlib.h>
 
14
 #include <unistd.h>
 
15
+#include <time.h>
 
16
 #include <syslog.h>
 
17
 #include <fcntl.h>
 
18
 #include <sys/ioctl.h>
 
19
@@ -589,6 +590,7 @@
 
20
        if (flush) {
 
21
                int round = 0;
 
22
                char flushb[4096-512];
 
23
+               time_t start = time(0);
 
24
 
 
25
                filter.flushb = flushb;
 
26
                filter.flushp = 0;
 
27
@@ -617,6 +619,12 @@
 
28
                                printf("Warum?\n");
 
29
                                return 1;
 
30
 
 
31
+                        if (time(0) - start > 10) {
 
32
+                                printf("\n*** Flush not completed after %ld seconds, %d entries remain ***\n",
 
33
+                                       time(0) - start, filter.flushed);
 
34
+                                exit(1);
 
35
+                        }
 
36
+
 
37
                        if (show_stats) {
 
38
                                printf("\n*** Round %d, deleting %d addresses ***\n", round, filter.flushed);
 
39
                                fflush(stdout);