X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=networking%2Fzcip.c;h=b5a904d469493da5056fa3fe6e7b7e4b364e041e;hb=5929edc1fac4340f99ed84e92bf3a2bedd4177c2;hp=11b2db526fb12ded520a3c44c15d6869329f9a30;hpb=0cb6f35c33a2a3fd390aaa36da72e0600f205918;p=oweals%2Fbusybox.git diff --git a/networking/zcip.c b/networking/zcip.c index 11b2db526..b5a904d46 100644 --- a/networking/zcip.c +++ b/networking/zcip.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -62,20 +61,22 @@ struct arp_packet { struct in_addr target_ip; } ATTRIBUTE_PACKED; +enum { /* 169.254.0.0 */ -static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000; + LINKLOCAL_ADDR = 0xa9fe0000, /* protocol timeout parameters, specified in seconds */ -static const unsigned PROBE_WAIT = 1; -static const unsigned PROBE_MIN = 1; -static const unsigned PROBE_MAX = 2; -static const unsigned PROBE_NUM = 3; -static const unsigned MAX_CONFLICTS = 10; -static const unsigned RATE_LIMIT_INTERVAL = 60; -static const unsigned ANNOUNCE_WAIT = 2; -static const unsigned ANNOUNCE_NUM = 2; -static const unsigned ANNOUNCE_INTERVAL = 2; -static const time_t DEFEND_INTERVAL = 10; + PROBE_WAIT = 1, + PROBE_MIN = 1, + PROBE_MAX = 2, + PROBE_NUM = 3, + MAX_CONFLICTS = 10, + RATE_LIMIT_INTERVAL = 60, + ANNOUNCE_WAIT = 2, + ANNOUNCE_NUM = 2, + ANNOUNCE_INTERVAL = 2, + DEFEND_INTERVAL = 10 +}; static const unsigned char ZCIP_VERSION[] = "0.75 (18 April 2005)"; static char *prog; @@ -435,7 +436,7 @@ fail: gettimeofday(&tv2, NULL); if (timercmp(&tv1, &tv2, <)) { - timeout = -1; + timeout = 0; } else { timersub(&tv1, &tv2, &tv1); timeout = 1000 * tv1.tv_sec