]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 4 Aug 2008 19:20:33 +0000 (19:20 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 4 Aug 2008 19:20:33 +0000 (19:20 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9221 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 7aa3673069af7e5f892272152c2dd72b022e6a63..07b6123c70f70b27f47c89232c4b255ca900226e 100644 (file)
@@ -1088,7 +1088,11 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                }
                                        } else if (!strcasecmp(var, "apply-nat-acl")) {
                                                if (profile->acl_count < SOFIA_MAX_ACL) {
-                                                       profile->nat_acl[profile->nat_acl_count++] = switch_core_strdup(profile->pool, val);
+                                                       if (!profile->extsipip && switch_check_network_list_ip(profile->sipip, val)) {
+                                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Not adding acl %s because it's the local network\n", val);
+                                                       } else {
+                                                               profile->nat_acl[profile->nat_acl_count++] = switch_core_strdup(profile->pool, val);
+                                                       }
                                                } else {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", SOFIA_MAX_ACL);
                                                }
@@ -1645,7 +1649,11 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                profile->context = switch_core_strdup(profile->pool, val);
                                        } else if (!strcasecmp(var, "apply-nat-acl")) {
                                                if (profile->acl_count < SOFIA_MAX_ACL) {
-                                                       profile->nat_acl[profile->nat_acl_count++] = switch_core_strdup(profile->pool, val);
+                                                       if (!profile->extsipip && switch_check_network_list_ip(profile->sipip, val)) {
+                                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Not adding acl %s because it's the local network\n", val);
+                                                       } else {
+                                                               profile->nat_acl[profile->nat_acl_count++] = switch_core_strdup(profile->pool, val);
+                                                       }
                                                } else {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", SOFIA_MAX_ACL);
                                                }