]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Remove unused variables from ebtablesContext
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 7 Mar 2014 16:54:28 +0000 (16:54 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Mar 2014 11:01:51 +0000 (11:01 +0000)
The input_filter and nat_postrouting variables were never
used to create any firewall rules.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/util/virebtables.c

index 9848f50b6375ee34403604ee26e74072838867bb..6f28b4b9c26c860a246312a25aca9296d24d44df 100644 (file)
@@ -86,9 +86,7 @@ VIR_ONCE_GLOBAL_INIT(virEbTables)
 
 struct _ebtablesContext
 {
-    ebtRules *input_filter;
     ebtRules *forward_filter;
-    ebtRules *nat_postrouting;
 };
 
 enum {
@@ -324,34 +322,21 @@ ebtablesContextNew(const char *driver)
 {
     bool success = false;
     ebtablesContext *ctx = NULL;
-    char *input_chain = NULL;
     char *forward_chain = NULL;
-    char *nat_chain = NULL;
 
     if (VIR_ALLOC(ctx) < 0)
         return NULL;
 
-    if (virAsprintf(&input_chain, "libvirt_%s_INPUT", driver) < 0 ||
-        virAsprintf(&forward_chain, "libvirt_%s_FORWARD", driver) < 0 ||
-        virAsprintf(&nat_chain, "libvirt_%s_POSTROUTING", driver) < 0) {
-        goto cleanup;
-    }
-
-    if (!(ctx->input_filter = ebtRulesNew("filter", input_chain)))
+    if (virAsprintf(&forward_chain, "libvirt_%s_FORWARD", driver) < 0)
         goto cleanup;
 
     if (!(ctx->forward_filter = ebtRulesNew("filter", forward_chain)))
         goto cleanup;
 
-    if (!(ctx->nat_postrouting = ebtRulesNew("nat", nat_chain)))
-        goto cleanup;
-
     success = true;
 
 cleanup:
-    VIR_FREE(input_chain);
     VIR_FREE(forward_chain);
-    VIR_FREE(nat_chain);
 
     if (!success) {
         ebtablesContextFree(ctx);
@@ -372,12 +357,8 @@ ebtablesContextFree(ebtablesContext *ctx)
 {
     if (!ctx)
         return;
-    if (ctx->input_filter)
-        ebtRulesFree(ctx->input_filter);
     if (ctx->forward_filter)
         ebtRulesFree(ctx->forward_filter);
-    if (ctx->nat_postrouting)
-        ebtRulesFree(ctx->nat_postrouting);
     VIR_FREE(ctx);
 }