head 1.4; access; symbols OPENPKG_E1_MP_HEAD:1.3 OPENPKG_E1_MP:1.3 OPENPKG_E1_MP_2_STABLE:1.3.2.2 OPENPKG_E1_FP:1.3.2.2 OPENPKG_2_STABLE_MP:1.3 OPENPKG_2_STABLE_20061018:1.3.2.2 OPENPKG_2_STABLE:1.3.0.2 OPENPKG_CW_FP:1.2; locks; strict; comment @# @; 1.4 date 2007.07.05.05.48.55; author rse; state Exp; branches; next 1.3; commitid V7uxV1XBxFIXAxos; 1.3 date 2006.02.19.08.01.46; author rse; state Exp; branches 1.3.2.1; next 1.2; commitid WxeAYrdLwU2Zqamr; 1.2 date 2004.11.03.13.24.01; author ms; state Exp; branches; next 1.1; 1.1 date 2004.11.02.17.58.30; author ms; state Exp; branches; next ; 1.3.2.1 date 2006.02.19.08.01.46; author rse; state dead; branches; next 1.3.2.2; commitid iZxwRSmmWscPXUQr; 1.3.2.2 date 2006.10.16.14.57.31; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; desc @@ 1.4 log @upgrading package: ucarp 1.2 -> 1.3 @ text @Index: src/carp.c --- src/carp.c.orig 2007-07-04 17:17:12 +0200 +++ src/carp.c 2007-07-05 07:44:10 +0200 @@@@ -133,7 +133,7 @@@@ return (unsigned short) ~sum; } -static void carp_hmac_generate(struct carp_softc *sc, u_int32_t counter[2], +static void carp_hmac_generate(struct carp_softc *sc, uint32_t counter[2], unsigned char *md) { SHA1_CTX ctx; Index: src/fillmac.c --- src/fillmac.c.orig 2007-07-04 15:34:59 +0200 +++ src/fillmac.c 2007-07-05 07:44:10 +0200 @@@@ -102,7 +102,7 @@@@ } return -1; } -#elif defined(SIOCGLIFNUM) +#elif defined(SIOCGLIFNUM) && !defined(__hpux) { struct lifconf lifc; struct lifnum lifn; Index: src/ip_carp.h --- src/ip_carp.h.orig 2007-07-04 15:35:07 +0200 +++ src/ip_carp.h 2007-07-05 07:44:10 +0200 @@@@ -56,19 +56,19 @@@@ struct carp_header { #ifdef WORDS_BIGENDIAN - u_int8_t carp_version:4, + uint8_t carp_version:4, carp_type:4; #else - u_int8_t carp_type:4, + uint8_t carp_type:4, carp_version:4; #endif - u_int8_t carp_vhid; /* virtual host id */ - u_int8_t carp_advskew; /* advertisement skew */ - u_int8_t carp_authlen; /* size of counter+md, 32bit chunks */ - u_int8_t carp_pad1; /* reserved */ - u_int8_t carp_advbase; /* advertisement interval */ - u_int16_t carp_cksum; - u_int32_t carp_counter[2]; + uint8_t carp_vhid; /* virtual host id */ + uint8_t carp_advskew; /* advertisement skew */ + uint8_t carp_authlen; /* size of counter+md, 32bit chunks */ + uint8_t carp_pad1; /* reserved */ + uint8_t carp_advbase; /* advertisement interval */ + uint16_t carp_cksum; + uint32_t carp_counter[2]; unsigned char carp_md[20]; /* SHA1 HMAC */ } __packed; @@@@ -91,24 +91,24 @@@@ * Statistics. */ struct carpstats { - u_int64_t carps_ipackets; /* total input packets, IPv4 */ - u_int64_t carps_ipackets6; /* total input packets, IPv6 */ - u_int64_t carps_badif; /* wrong interface */ - u_int64_t carps_badttl; /* TTL is not CARP_DFLTTL */ - u_int64_t carps_hdrops; /* packets shorter than header */ - u_int64_t carps_badsum; /* bad checksum */ - u_int64_t carps_badver; /* bad (incl unsupp) version */ - u_int64_t carps_badlen; /* data length does not match */ - u_int64_t carps_badauth; /* bad authentication */ - u_int64_t carps_badvhid; /* bad VHID */ - u_int64_t carps_badaddrs; /* bad address list */ - - u_int64_t carps_opackets; /* total output packets, IPv4 */ - u_int64_t carps_opackets6; /* total output packets, IPv6 */ - u_int64_t carps_onomem; /* no memory for an mbuf */ - u_int64_t carps_ostates; /* total state updates sent */ + uint64_t carps_ipackets; /* total input packets, IPv4 */ + uint64_t carps_ipackets6; /* total input packets, IPv6 */ + uint64_t carps_badif; /* wrong interface */ + uint64_t carps_badttl; /* TTL is not CARP_DFLTTL */ + uint64_t carps_hdrops; /* packets shorter than header */ + uint64_t carps_badsum; /* bad checksum */ + uint64_t carps_badver; /* bad (incl unsupp) version */ + uint64_t carps_badlen; /* data length does not match */ + uint64_t carps_badauth; /* bad authentication */ + uint64_t carps_badvhid; /* bad VHID */ + uint64_t carps_badaddrs; /* bad address list */ + + uint64_t carps_opackets; /* total output packets, IPv4 */ + uint64_t carps_opackets6; /* total output packets, IPv6 */ + uint64_t carps_onomem; /* no memory for an mbuf */ + uint64_t carps_ostates; /* total state updates sent */ - u_int64_t carps_preempt; /* if enabled, preemptions */ + uint64_t carps_preempt; /* if enabled, preemptions */ }; /* Index: src/ucarp.h --- src/ucarp.h.orig 2007-07-04 16:24:07 +0200 +++ src/ucarp.h 2007-07-05 07:46:30 +0200 @@@@ -63,10 +63,10 @@@@ #include #ifdef __sun__ -# define u_int8_t uint8_t -# define u_int16_t uint16_t -# define u_int32_t uint32_t -# define u_int64_t uint64_t +# define uint8_t uint8_t +# define uint16_t uint16_t +# define uint32_t uint32_t +# define uint64_t uint64_t # define ether_shost ether_shost.ether_addr_octet # define ether_dhost ether_dhost.ether_addr_octet #endif @@@@ -192,7 +192,7 @@@@ int sc_naddrs6; int sc_advbase; /* seconds */ int sc_init_counter; - u_int64_t sc_counter; + uint64_t sc_counter; int sc_delayed_arp; /* authentication */ @ 1.3 log @upgrading package: ucarp 1.1 -> 1.2 @ text @d2 2 a3 2 --- src/carp.c.orig 2006-02-19 00:06:17 +0100 +++ src/carp.c 2006-02-19 08:25:51 +0100 d14 2 a15 2 --- src/fillmac.c.orig 2004-08-28 17:15:36 +0200 +++ src/fillmac.c 2006-02-19 08:25:50 +0100 a24 16 @@@@ -130,13 +130,13 @@@@ return -1; } lifr = lifc.lifc_req; - while (--lifn.lifn_count > 0) { + while (lifn.lifn_count-- > 0) { if (strcmp(lifr->lifr_name, interface) == 0) { break; } lifr++; } - if (lifn.lifn_count <= 0) { + if (lifn.lifn_count < 0) { logfile(LOG_ERR, _("Interface [%s] not found"), interface); ALLOCA_FREE(lifrspace); return -1; d26 2 a27 2 --- src/ip_carp.h.orig 2006-02-19 00:03:58 +0100 +++ src/ip_carp.h 2006-02-19 08:25:51 +0100 d100 2 a101 2 --- src/ucarp.h.orig 2004-08-28 18:10:28 +0200 +++ src/ucarp.h 2006-02-19 08:25:51 +0100 d117 1 a117 10 @@@@ -122,7 +122,7 @@@@ # define IPPROTO_CARP 112 #endif #ifndef INADDR_CARP_GROUP -# define __OBSD_IPADDR(x) ((u_int32_t) htonl((u_int32_t)(x))) +# define __OBSD_IPADDR(x) ((uint32_t) htonl((uint32_t)(x))) # define INADDR_CARP_GROUP __OBSD_IPADDR(0xe0000012) /* 224.0.0.18 */ #endif #ifndef timercmp @@@@ -194,7 +194,7 @@@@ d123 1 a125 1 #define CARP_HMAC_PAD 64 @ 1.3.2.1 log @file ucarp.patch was added on branch OPENPKG_2_STABLE on 2006-10-16 14:57:31 +0000 @ text @d1 150 @ 1.3.2.2 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @a0 150 Index: src/carp.c --- src/carp.c.orig 2006-02-19 00:06:17 +0100 +++ src/carp.c 2006-02-19 08:25:51 +0100 @@@@ -133,7 +133,7 @@@@ return (unsigned short) ~sum; } -static void carp_hmac_generate(struct carp_softc *sc, u_int32_t counter[2], +static void carp_hmac_generate(struct carp_softc *sc, uint32_t counter[2], unsigned char *md) { SHA1_CTX ctx; Index: src/fillmac.c --- src/fillmac.c.orig 2004-08-28 17:15:36 +0200 +++ src/fillmac.c 2006-02-19 08:25:50 +0100 @@@@ -102,7 +102,7 @@@@ } return -1; } -#elif defined(SIOCGLIFNUM) +#elif defined(SIOCGLIFNUM) && !defined(__hpux) { struct lifconf lifc; struct lifnum lifn; @@@@ -130,13 +130,13 @@@@ return -1; } lifr = lifc.lifc_req; - while (--lifn.lifn_count > 0) { + while (lifn.lifn_count-- > 0) { if (strcmp(lifr->lifr_name, interface) == 0) { break; } lifr++; } - if (lifn.lifn_count <= 0) { + if (lifn.lifn_count < 0) { logfile(LOG_ERR, _("Interface [%s] not found"), interface); ALLOCA_FREE(lifrspace); return -1; Index: src/ip_carp.h --- src/ip_carp.h.orig 2006-02-19 00:03:58 +0100 +++ src/ip_carp.h 2006-02-19 08:25:51 +0100 @@@@ -56,19 +56,19 @@@@ struct carp_header { #ifdef WORDS_BIGENDIAN - u_int8_t carp_version:4, + uint8_t carp_version:4, carp_type:4; #else - u_int8_t carp_type:4, + uint8_t carp_type:4, carp_version:4; #endif - u_int8_t carp_vhid; /* virtual host id */ - u_int8_t carp_advskew; /* advertisement skew */ - u_int8_t carp_authlen; /* size of counter+md, 32bit chunks */ - u_int8_t carp_pad1; /* reserved */ - u_int8_t carp_advbase; /* advertisement interval */ - u_int16_t carp_cksum; - u_int32_t carp_counter[2]; + uint8_t carp_vhid; /* virtual host id */ + uint8_t carp_advskew; /* advertisement skew */ + uint8_t carp_authlen; /* size of counter+md, 32bit chunks */ + uint8_t carp_pad1; /* reserved */ + uint8_t carp_advbase; /* advertisement interval */ + uint16_t carp_cksum; + uint32_t carp_counter[2]; unsigned char carp_md[20]; /* SHA1 HMAC */ } __packed; @@@@ -91,24 +91,24 @@@@ * Statistics. */ struct carpstats { - u_int64_t carps_ipackets; /* total input packets, IPv4 */ - u_int64_t carps_ipackets6; /* total input packets, IPv6 */ - u_int64_t carps_badif; /* wrong interface */ - u_int64_t carps_badttl; /* TTL is not CARP_DFLTTL */ - u_int64_t carps_hdrops; /* packets shorter than header */ - u_int64_t carps_badsum; /* bad checksum */ - u_int64_t carps_badver; /* bad (incl unsupp) version */ - u_int64_t carps_badlen; /* data length does not match */ - u_int64_t carps_badauth; /* bad authentication */ - u_int64_t carps_badvhid; /* bad VHID */ - u_int64_t carps_badaddrs; /* bad address list */ - - u_int64_t carps_opackets; /* total output packets, IPv4 */ - u_int64_t carps_opackets6; /* total output packets, IPv6 */ - u_int64_t carps_onomem; /* no memory for an mbuf */ - u_int64_t carps_ostates; /* total state updates sent */ + uint64_t carps_ipackets; /* total input packets, IPv4 */ + uint64_t carps_ipackets6; /* total input packets, IPv6 */ + uint64_t carps_badif; /* wrong interface */ + uint64_t carps_badttl; /* TTL is not CARP_DFLTTL */ + uint64_t carps_hdrops; /* packets shorter than header */ + uint64_t carps_badsum; /* bad checksum */ + uint64_t carps_badver; /* bad (incl unsupp) version */ + uint64_t carps_badlen; /* data length does not match */ + uint64_t carps_badauth; /* bad authentication */ + uint64_t carps_badvhid; /* bad VHID */ + uint64_t carps_badaddrs; /* bad address list */ + + uint64_t carps_opackets; /* total output packets, IPv4 */ + uint64_t carps_opackets6; /* total output packets, IPv6 */ + uint64_t carps_onomem; /* no memory for an mbuf */ + uint64_t carps_ostates; /* total state updates sent */ - u_int64_t carps_preempt; /* if enabled, preemptions */ + uint64_t carps_preempt; /* if enabled, preemptions */ }; /* Index: src/ucarp.h --- src/ucarp.h.orig 2004-08-28 18:10:28 +0200 +++ src/ucarp.h 2006-02-19 08:25:51 +0100 @@@@ -63,10 +63,10 @@@@ #include #ifdef __sun__ -# define u_int8_t uint8_t -# define u_int16_t uint16_t -# define u_int32_t uint32_t -# define u_int64_t uint64_t +# define uint8_t uint8_t +# define uint16_t uint16_t +# define uint32_t uint32_t +# define uint64_t uint64_t # define ether_shost ether_shost.ether_addr_octet # define ether_dhost ether_dhost.ether_addr_octet #endif @@@@ -122,7 +122,7 @@@@ # define IPPROTO_CARP 112 #endif #ifndef INADDR_CARP_GROUP -# define __OBSD_IPADDR(x) ((u_int32_t) htonl((u_int32_t)(x))) +# define __OBSD_IPADDR(x) ((uint32_t) htonl((uint32_t)(x))) # define INADDR_CARP_GROUP __OBSD_IPADDR(0xe0000012) /* 224.0.0.18 */ #endif #ifndef timercmp @@@@ -194,7 +194,7 @@@@ int sc_naddrs6; int sc_advbase; /* seconds */ int sc_init_counter; - u_int64_t sc_counter; + uint64_t sc_counter; /* authentication */ #define CARP_HMAC_PAD 64 @ 1.2 log @port to HP/UX @ text @d1 12 d14 2 a15 3 diff -Nau src/fillmac.c.orig src/fillmac.c --- src/fillmac.c.orig 2004-11-02 13:44:05.332518385 +0100 +++ src/fillmac.c 2004-11-02 14:19:17.771423871 +0100 d41 110 a150 54 Index: src/ucarp_p.h diff -Nau src/ucarp_p.h.orig src/ucarp_p.h --- src/ucarp_p.h.orig 2004-11-02 15:46:51.076457056 +0100 +++ src/ucarp_p.h 2004-11-02 16:06:45.548484801 +0100 @@@@ -1,7 +1,7 @@@@ #ifndef __CARP_P_H__ #define __CARP_P_H__ 1 -static const char *GETOPT_OPTIONS = "i:s:v:p:Pa:hb:k:u:d:r:zf:B"; +static const char *GETOPT_OPTIONS = ""; static struct option long_options[] = { { "interface", 1, NULL, 'i' }, Index: src/ucarp.c diff -Nau src/ucarp.c.orig src/ucarp.c --- src/ucarp.c.orig 2004-08-28 18:04:05.000000000 +0200 +++ src/ucarp.c 2004-11-02 16:10:59.801007425 +0100 @@@@ -23,21 +23,21 @@@@ { puts("\n" PACKAGE_STRING " - " __DATE__ "\n"); fputs(_( - "--interface= (-i ): bind interface \n" - "--srcip= (-s ): source (real) IP address of that host\n" - "--vhid= (-v ): virtual IP identifier (1-255)\n" - "--pass= (-p ): password\n" - "--preempt (-P): becomes a master as soon as possible\n" - "--addr= (-a ): virtual shared IP address\n" - "--help (-h): summary of command-line options\n" - "--advbase= (-b ): advertisement frequency\n" - "--advskew= (-k ): advertisement skew (0-255)\n" - "--upscript= (-u ): run to become a master\n" - "--downscript= (-d ): run to become a backup\n" - "--deadratio= (-r ): ratio to consider a host as dead\n" - "--shutdown (-z): call shutdown script at exit\n" - "--daemonize (-B): run in background\n" - "--facility= (-f): set syslog facility (default=daemon)\n" + "--interface=: bind interface \n" + "--srcip=: source (real) IP address of that host\n" + "--vhid=: virtual IP identifier (1-255)\n" + "--pass=: password\n" + "--preempt: becomes a master as soon as possible\n" + "--addr=: virtual shared IP address\n" + "--help: summary of command-line options\n" + "--advbase=: advertisement frequency\n" + "--advskew=: advertisement skew (0-255)\n" + "--upscript=: run to become a master\n" + "--downscript=: run to become a backup\n" + "--deadratio=: ratio to consider a host as dead\n" + "--shutdown: call shutdown script at exit\n" + "--daemonize: run in background\n" + "--facility=: set syslog facility (default=daemon)\n" "\n" "Sample usage:\n" "\n" @ 1.1 log @allow fine grained control over runtime configuration, correct mode of and expand syntax of up and down scripts, improve description, patch to correctly find and use network devices either implicitly or explicitly, and unfortunately remove all short option forms because they are horribly implemented (segfault most of the time) @ text @d5 9 @