#ifdef HAVE_GEOIP
/* Look up addresses in GeoIP */
-static gboolean ip_use_geoip = FALSE;
+static gboolean ip_use_geoip = TRUE;
#endif /* HAVE_GEOIP */
/* Interpret the reserved flag as security flag (RFC 3514) */
guint item_cnt;
num_dbs = geoip_db_num_dbs();
+ if (num_dbs < 1) return;
geoip_info_item = proto_tree_add_text(tree, tvb, offset + IPH_SRC, 4, "Source GeoIP: ");
geoip_info_tree = proto_item_add_subtree(geoip_info_item, ett_geoip_info);
/* if IP is not referenced from any filters we dont need to worry about
generating any tree items. We must do this after we created the actual
protocol above so that proto hier stat still works though.
- XXX: Note that because of the following optimization expert items must
- not be generated inside of an 'if (tree) ...'
+ XXX: Note that because of the following optimization expert items must
+ not be generated inside of an 'if (tree) ...'
so that Analyze ! Expert ... will work.
*/
if(!proto_field_is_referenced(parent_tree, proto_ip)){
if (tree==NULL) then item will be NULL
else item should be from the add_boolean(..., hf_ip_checksum_bad, ...) above */
expert_add_info_format(pinfo, item, PI_CHECKSUM, PI_ERROR, "Bad checksum");
- } else {
+ } else {
ipsum = 0;
if (tree) {
item = proto_tree_add_uint_format(ip_tree, hf_ip_checksum, tvb, offset + 10, 2, iph->ip_sum,
#ifdef HAVE_GEOIP_V6
/* Look up addresses in GeoIP */
-static gboolean ipv6_use_geoip = FALSE;
+static gboolean ipv6_use_geoip = TRUE;
#endif /* HAVE_GEOIP_V6 */
#ifndef offsetof
guint item_cnt;
num_dbs = geoip_db_num_dbs();
+ if (num_dbs < 1) return;
geoip_info_item = proto_tree_add_text(tree, tvb, offset + IP6H_SRC, 16, "Source GeoIP: ");
geoip_info_tree = proto_item_add_subtree(geoip_info_item, ett_geoip_info);