Module: sip-router
Branch: sr_3.0
Commit: 5927281f4c8c80dd0ca5c066ac9f1d63438d2bf4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5927281…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Thu Mar 4 09:09:22 2010 +0200
* modules_k/permissions: subnet matching fix (credits to anonymous)
(cherry picked from commit f5a29762b6155209721ba0dfc3f30b4a9764c191)
---
modules_k/permissions/hash.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules_k/permissions/hash.c b/modules_k/permissions/hash.c
index 7358225..5c5c7a6 100644
--- a/modules_k/permissions/hash.c
+++ b/modules_k/permissions/hash.c
@@ -565,7 +565,7 @@ int find_group_in_subnet_table(struct subnet* table,
i = 0;
while (i < count) {
- subnet = ip_addr << table[i].mask;
+ subnet = htonl(ntohl(ip_addr) >> table[i].mask);
if ((table[i].subnet == subnet) &&
((table[i].port == port) || (table[i].port == 0)))
return table[i].grp;