From: Andre Noll Date: Wed, 3 Jan 2018 13:12:00 +0000 (+0100) Subject: acl: Fix/improve acl_del_entry log message. X-Git-Tag: v0.6.2~4^2~28 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=7c19c1eab09b846325f20f49cf4d305e46917b83;p=paraslash.git acl: Fix/improve acl_del_entry log message. The given address/netmask can match any number of entries. Currently we log one message per removed address but all messages contain the address/netmask to match rather than the removed one that was stored in the acl. This patch changes acl_del_entry() to log both, with different severities. --- diff --git a/acl.c b/acl.c index 75fdc55b..2c900526 100644 --- a/acl.c +++ b/acl.c @@ -101,14 +101,18 @@ static void acl_del_entry(struct list_head *acl, char *addr, unsigned netmask) struct access_info *ai, *tmp; struct in_addr to_delete; + PARA_NOTICE_LOG("removing entries matching %s/%u\n", addr, netmask); inet_pton(AF_INET, addr, &to_delete); list_for_each_entry_safe(ai, tmp, acl, node) { - if (v4_addr_match(to_delete.s_addr, ai->addr.s_addr, PARA_MIN(netmask, ai->netmask))) { - PARA_NOTICE_LOG("removing %s/%u from access list\n", - addr, ai->netmask); + char dst[INET_ADDRSTRLEN + 1]; + const char *p = inet_ntop(AF_INET, &ai->addr.s_addr, + dst, sizeof(dst)); + if (p) + PARA_INFO_LOG("removing %s/%u\n", p, + ai->netmask); list_del(&ai->node); free(ai); }