[sr-dev] git:4.4:486341c7: geoip2: Improve detection of addresses used by anonymous proxies

Daniel-Constantin Mierla miconda at gmail.com
Wed Mar 30 14:57:52 CEST 2016


Module: kamailio
Branch: 4.4
Commit: 486341c76bc09fb5ead0fa63b890adb260871740
URL: https://github.com/kamailio/kamailio/commit/486341c76bc09fb5ead0fa63b890adb260871740

Author: Sergey Okhapkin <root at west2.callwithus.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-03-30T14:32:58+02:00

geoip2: Improve detection of addresses used by anonymous proxies

(cherry picked from commit c49011c2cc63d35bca6904748da166814a792fc9)

---

Modified: modules/geoip2/geoip2_pv.c

---

Diff:  https://github.com/kamailio/kamailio/commit/486341c76bc09fb5ead0fa63b890adb260871740.diff
Patch: https://github.com/kamailio/kamailio/commit/486341c76bc09fb5ead0fa63b890adb260871740.patch

---

diff --git a/modules/geoip2/geoip2_pv.c b/modules/geoip2/geoip2_pv.c
index 69bd719..e239d96 100644
--- a/modules/geoip2/geoip2_pv.c
+++ b/modules/geoip2/geoip2_pv.c
@@ -407,7 +407,11 @@ int pv_get_geoip2(struct sip_msg *msg, pv_param_t *param,
 					return pv_get_null(msg, param, res);
 				if(MMDB_get_value(&gpv->item->r.record.entry, &entry_data,
 					"country","iso_code", NULL
-					) != MMDB_SUCCESS)
+					) != MMDB_SUCCESS
+					&& MMDB_get_value(&gpv->item->r.record.entry, &entry_data,
+						"registered_country","iso_code", NULL
+						) != MMDB_SUCCESS
+					)
 					return pv_get_null(msg, param, res);
 				if(entry_data.has_data && entry_data.type == MMDB_DATA_TYPE_UTF8_STRING) {
 					gpv->item->r.country.s = (char *)entry_data.utf8_string;




More information about the sr-dev mailing list