--- src/fuser.c.orig 2005-11-21 00:58:12 +0000 +++ src/fuser.c 2005-11-21 00:58:21 +0000 @@ -50,6 +50,10 @@ #include "signals.h" #include "i18n.h" +#ifdef __UCLIBC__ +#define IPV4_ONLY +#endif + #undef DEBUG #define NAME_FIELD 20 /* space reserved for file name */ @@ -228,6 +232,7 @@ *ip_list = ip_tmp; } +#ifndef IPV4_ONLY static void add_ip6_conn(struct ip6_connections **ip_list, const char *protocol, struct names *this_name, const int lcl_port, const int rmt_port, struct in6_addr rmt_address) { struct ip6_connections *ip_tmp, *ip_head; @@ -244,7 +249,7 @@ *ip_list = ip_tmp; } - +#endif static void add_matched_proc(struct names *name_list, const pid_t pid, const uid_t uid, const char access) { struct procs *pptr, *last_proc; @@ -355,7 +360,9 @@ char *lcl_port_str, *rmt_addr_str, *rmt_port_str, *tmpstr, *tmpstr2; in_port_t lcl_port; struct sockaddr_in *sin; +#ifndef IPV4_ONLY struct sockaddr_in6 *sin6; +#endif char hostspec[100]; char *protocol; int i; @@ -442,7 +449,9 @@ res = NULL; if (rmt_addr_str == NULL && rmt_port_str == NULL) { add_ip_conn(ip_list, protocol, this_name, ntohs(lcl_port), 0, INADDR_ANY); +#ifndef IPV4_ONLY add_ip6_conn(ip6_list, protocol,this_name, ntohs(lcl_port), 0, in6addr_any); +#endif return 0; } else { /* Resolve remote address and port */ @@ -453,10 +462,12 @@ sin = (struct sockaddr_in*)resptr->ai_addr; add_ip_conn(ip_list, protocol, this_name, ntohs(lcl_port), ntohs(sin->sin_port), sin->sin_addr.s_addr); break; +#ifndef IPV4_ONLY case AF_INET6: sin6 = (struct sockaddr_in6*)resptr->ai_addr; add_ip6_conn(ip6_list, protocol, this_name, ntohs(lcl_port), ntohs(sin6->sin6_port), sin6->sin6_addr); break; +#endif } } /*while */ return 0;