- list_for_each_entry_safe(ai, tmp, &access_perm_list, node) {
- unsigned mask = ((~0U) >> ai->netmask);
- if ((hc->addr.sin_addr.s_addr & mask) == (ai->addr.s_addr & mask))
- return 1;
+ struct sockaddr_storage ss;
+ socklen_t sslen = sizeof(ss);
+ struct in_addr v4_addr;
+
+ if (getpeername(hc->fd, (struct sockaddr *)&ss, &sslen) < 0) {
+ PARA_ERROR_LOG("Can not determine peer address: %s\n", strerror(errno));
+ goto no_match;