nat: No need to 'nat' table anymore
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 12 Feb 2013 09:19:45 +0000 (10:19 +0100)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Tue, 12 Feb 2013 10:33:57 +0000 (12:33 +0200)
This is done in iptables.c directly.

src/nat.c

index 927d305..236f545 100644 (file)
--- a/src/nat.c
+++ b/src/nat.c
@@ -57,20 +57,6 @@ static int enable_ip_forward(connman_bool_t enable)
        return 0;
 }
 
-static void flush_nat(void)
-{
-       int err;
-
-       err = __connman_iptables_command("-t nat -F POSTROUTING");
-       if (err < 0) {
-               DBG("Flushing the nat table failed");
-
-               return;
-       }
-
-       __connman_iptables_commit("nat");
-}
-
 static int enable_nat(struct connman_nat *nat)
 {
        int err;
@@ -217,8 +203,6 @@ int __connman_nat_init(void)
        nat_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
                                                g_free, cleanup_nat);
 
-       flush_nat();
-
        return 0;
 }
 
@@ -230,7 +214,5 @@ void __connman_nat_cleanup(void)
        g_hash_table_destroy(nat_hash);
        nat_hash = NULL;
 
-       flush_nat();
-
        connman_notifier_unregister(&nat_notifier);
 }