+#endif
+}
+
+bool
+sockcmp(struct rb_sockaddr_storage *addr, struct rb_sockaddr_storage *addr2, int family)
+{
+ if(family == AF_INET)
+ {
+ struct sockaddr_in *ip, *ip2;
+ ip = (struct sockaddr_in *)addr;
+ ip2 = (struct sockaddr_in *)addr2;
+
+ return ip->sin_addr.s_addr == ip2->sin_addr.s_addr;
+ }
+#ifdef RB_IPV6
+ else if(family == AF_INET6)
+ {
+ struct sockaddr_in6 *ip, *ip2;
+ ip = (struct sockaddr_in6 *) addr;
+ ip2 = (struct sockaddr_in6 *) addr2;
+
+ return(memcmp(&ip->sin6_addr, &ip2->sin6_addr, sizeof(struct in6_addr)) == 0);
+ }
+#endif
+
+ return false;