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 <pcap.h>
 
 #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
