iptables-1.3.2-20050720
[iptables.git] / ip6tables-save.c
index 77cc325..37b1f19 100644 (file)
@@ -100,7 +100,7 @@ static int print_match(const struct ip6t_entry_match *e,
                        const struct ip6t_ip6 *ip)
 {
        struct ip6tables_match *match
-               = find_match(e->u.user.name, TRY_LOAD);
+               = find_match(e->u.user.name, TRY_LOAD, NULL);
 
        if (match) {
                printf("-m %s ", e->u.user.name);
@@ -149,7 +149,7 @@ static void print_rule(const struct ip6t_entry *e,
 
        /* print counters */
        if (counters)
-               printf("[%llu:%llu] ", e->counters.pcnt, e->counters.bcnt);
+               printf("[%llu:%llu] ", (unsigned long long)e->counters.pcnt, (unsigned long long)e->counters.bcnt);
 
        /* print chain name */
        printf("-A %s ", chain);
@@ -277,7 +277,7 @@ static int do_output(const char *tablename)
                                struct ip6t_counters count;
                                printf("%s ",
                                       ip6tc_get_policy(chain, &count, &h));
-                               printf("[%llu:%llu]\n", count.pcnt, count.bcnt);
+                               printf("[%llu:%llu]\n", (unsigned long long)count.pcnt, (unsigned long long)count.bcnt);
                        } else {
                                printf("- [0:0]\n");
                        }
@@ -322,6 +322,10 @@ int main(int argc, char *argv[])
        program_name = "ip6tables-save";
        program_version = IPTABLES_VERSION;
 
+       lib_dir = getenv("IP6TABLES_LIB_DIR");
+       if (!lib_dir)
+               lib_dir = IP6T_LIB_DIR;
+
 #ifdef NO_SHARED_LIBS
        init_extensions();
 #endif