*: use an ifindex_t type, defined in lib/if.h, for ifindex values
diff --git a/lib/sockopt.c b/lib/sockopt.c
index 257271b..3014237 100644
--- a/lib/sockopt.c
+++ b/lib/sockopt.c
@@ -220,7 +220,7 @@
 setsockopt_ipv4_multicast(int sock,
 			int optname, 
 			unsigned int mcast_addr,
-			unsigned int ifindex)
+			ifindex_t ifindex)
 {
 #ifdef HAVE_RFC3678
   struct group_req gr;
@@ -318,8 +318,7 @@
  * Set IP_MULTICAST_IF socket option in an OS-dependent manner.
  */
 int
-setsockopt_ipv4_multicast_if(int sock,
-			unsigned int ifindex)
+setsockopt_ipv4_multicast_if(int sock, ifindex_t ifindex)
 {
 
 #ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX
@@ -345,7 +344,7 @@
 }
   
 static int
-setsockopt_ipv4_ifindex (int sock, int val)
+setsockopt_ipv4_ifindex (int sock, ifindex_t val)
 {
   int ret;
 
@@ -381,7 +380,7 @@
 
 
 int
-setsockopt_ifindex (int af, int sock, int val)
+setsockopt_ifindex (int af, int sock, ifindex_t val)
 {
   int ret = -1;
   
@@ -408,11 +407,11 @@
  * Returns the interface index (small integer >= 1) if it can be
  * determined, or else 0.
  */
-static int
+static ifindex_t
 getsockopt_ipv4_ifindex (struct msghdr *msgh)
 {
   /* XXX: initialize to zero?  (Always overwritten, so just cosmetic.) */
-  int ifindex = -1;
+  ifindex_t ifindex = -1;
 
 #if defined(IP_PKTINFO)
 /* Linux pktinfo based ifindex retrieval */
@@ -432,7 +431,7 @@
   struct sockaddr_dl *sdl;
 #else
   /* SUNOS_5 uses an integer with the index. */
-  int *ifindex_p;
+  ifindex_t *ifindex_p;
 #endif /* SUNOS_5 */
 
 #ifndef SUNOS_5
@@ -473,7 +472,7 @@
 }
 
 /* return ifindex, 0 if none found */
-int
+ifindex_t
 getsockopt_ifindex (int af, struct msghdr *msgh)
 {
   switch (af)