From 7c19c1eab09b846325f20f49cf4d305e46917b83 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 3 Jan 2018 14:12:00 +0100 Subject: [PATCH] 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. --- acl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); } -- 2.39.5