summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/fromd/ip_desc_db.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/daemon/fromd/ip_desc_db.c b/daemon/fromd/ip_desc_db.c
index bd1b85d6..1870a9d3 100644
--- a/daemon/fromd/ip_desc_db.c
+++ b/daemon/fromd/ip_desc_db.c
@@ -91,9 +91,10 @@ int ip_desc_db_reload(const char * cfgfile)
const char * ip_desc_db_lookup(const char * ip)
{
int i;
+ uint32_t ipaddr = htonl(ipstr2int(ip));
for (i = 0; i < db_len; i++) {
- if (db[i].network == (htonl(ipstr2int(ip)) & db[i].netmask)) {
+ if (db[i].network == (ipaddr & db[i].netmask)) {
return db[i].desc;
}
}