+Thu Jan 10 13:56:33 GMT 2008 Mark McLoughlin <markmc@redhat.com>
+
+ Like --with-iptables-prefix, --with-iptables-dir is no
+ longer useful, so let's remove it.
+
+ * configure.in, src/iptables.c: remove --with-iptables-dir
+
Thu Jan 10 13:54:10 GMT 2008 Mark McLoughlin <markmc@redhat.com>
--with-iptables-prefix was added to integrate with
AM_CONDITIONAL(LIBVIRT_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
AC_MSG_RESULT($with_init_scripts)
-dnl
-dnl also support saving the various chains to files
-dnl in e.g. /etc/sysconfig/iptables.d
-dnl
-AC_ARG_WITH(iptables-dir,
- AC_HELP_STRING([--with-iptables-dir=path],
- [directory used to save iptables chains, defaults to not saving]),
- [IPTABLES_DIR=$withval])
-if test x"$IPTABLES_DIR" != "x"; then
- AC_DEFINE_UNQUOTED(IPTABLES_DIR, "$IPTABLES_DIR", [directory used for saving iptables chains])
-fi
-
dnl
dnl ensure that Fedora's system-config-firewall knows
dnl about libvirt's iptables rules
#define qemudLog(level, msg...) fprintf(stderr, msg)
-#ifdef ENABLE_IPTABLES_LOKKIT
-#undef IPTABLES_DIR
-#define IPTABLES_DIR LOCAL_STATE_DIR "/lib/libvirt/iptables"
-#endif
-
enum {
ADD = 0,
REMOVE
int nrules;
iptRule *rules;
-#ifdef IPTABLES_DIR
+#ifdef ENABLE_IPTABLES_LOKKIT
char dir[PATH_MAX];
char path[PATH_MAX];
-#endif /* IPTABLES_DIR */
+#endif /* ENABLE_IPTABLES_LOKKIT */
} iptRules;
iptRules *nat_postrouting;
};
-#ifdef IPTABLES_DIR
#ifdef ENABLE_IPTABLES_LOKKIT
static void
notifyRulesUpdated(const char *table,
#undef MAX_FILE_LEN
}
-#endif /* ENABLE_IPTABLES_LOKKIT */
static int
writeRules(const char *path,
return 0;
}
-#endif /* IPTABLES_DIR */
+#endif /* ENABLE_IPTABLES_LOKKIT */
static void
iptRuleFree(iptRule *rule)
rules->nrules++;
-#ifdef IPTABLES_DIR
+#ifdef ENABLE_IPTABLES_LOKKIT
{
int err;
return err;
}
-#ifdef ENABLE_IPTABLES_LOKKIT
notifyRulesUpdated(rules->table, rules->path);
#endif /* ENABLE_IPTABLES_LOKKIT */
-#endif /* IPTABLES_DIR */
-
return 0;
}
rules->nrules--;
-#ifdef IPTABLES_DIR
+#ifdef ENABLE_IPTABLES_LOKKIT
{
int err;
return err;
}
-#ifdef ENABLE_IPTABLES_LOKKIT
if (rules->nrules > 0)
notifyRulesUpdated(rules->table, rules->path);
else
notifyRulesRemoved(rules->table, rules->path);
#endif /* ENABLE_IPTABLES_LOKKIT */
-#endif /* IPTABLES_DIR */
-
return 0;
}
rules->nrules = 0;
}
-#ifdef IPTABLES_DIR
+#ifdef ENABLE_IPTABLES_LOKKIT
rules->dir[0] = '\0';
rules->path[0] = '\0';
-#endif /* IPTABLES_DIR */
+#endif /* ENABLE_IPTABLES_LOKKIT */
free(rules);
}
rules->rules = NULL;
rules->nrules = 0;
-#ifdef IPTABLES_DIR
- if (virFileBuildPath(IPTABLES_DIR, table, NULL, rules->dir, sizeof(rules->dir)) < 0)
+#ifdef ENABLE_IPTABLES_LOKKIT
+ if (virFileBuildPath(LOCAL_STATE_DIR "/lib/libvirt/iptables", table, NULL,
+ rules->dir, sizeof(rules->dir)) < 0)
goto error;
if (virFileBuildPath(rules->dir, chain, ".chain", rules->path, sizeof(rules->path)) < 0)
goto error;
-#endif /* IPTABLES_DIR */
+#endif /* ENABLE_IPTABLES_LOKKIT */
return rules;