--- ../iptables/iptables.c.orig 2008-03-10 14:10:27.000000000 +0100 +++ ../iptables/iptables.c 2008-03-10 14:15:52.000000000 +0100 @@ -99,38 +99,38 @@ = { 'n', 's', 'd', 'p', 'j', 'v', 'x', 'i', 'o', 'f', '0', 'c'}; static struct option original_opts[] = { - { "append", 1, NULL, 'A' }, - { "delete", 1, NULL, 'D' }, - { "insert", 1, NULL, 'I' }, - { "replace", 1, NULL, 'R' }, - { "list", 2, NULL, 'L' }, - { "flush", 2, NULL, 'F' }, - { "zero", 2, NULL, 'Z' }, - { "new-chain", 1, NULL, 'N' }, - { "delete-chain", 2, NULL, 'X' }, - { "rename-chain", 1, NULL, 'E' }, - { "policy", 1, NULL, 'P' }, - { "source", 1, NULL, 's' }, - { "destination", 1, NULL, 'd' }, - { "src", 1, NULL, 's' }, /* synonym */ - { "dst", 1, NULL, 'd' }, /* synonym */ - { "protocol", 1, NULL, 'p' }, - { "in-interface", 1, NULL, 'i' }, - { "jump", 1, NULL, 'j' }, - { "table", 1, NULL, 't' }, - { "match", 1, NULL, 'm' }, - { "numeric", 0, NULL, 'n' }, - { "out-interface", 1, NULL, 'o' }, - { "verbose", 0, NULL, 'v' }, - { "exact", 0, NULL, 'x' }, - { "fragments", 0, NULL, 'f' }, - { "version", 0, NULL, 'V' }, - { "help", 2, NULL, 'h' }, - { "line-numbers", 0, NULL, '0' }, - { "modprobe", 1, NULL, 'M' }, - { "set-counters", 1, NULL, 'c' }, - { "goto", 1, NULL, 'g' }, - { } + { .name = "append", .has_arg = 1, .flag = NULL, .val = 'A' }, + { .name = "delete", .has_arg = 1, .flag = NULL, .val = 'D' }, + { .name = "insert", .has_arg = 1, .flag = NULL, .val = 'I' }, + { .name = "replace", .has_arg = 1, .flag = NULL, .val = 'R' }, + { .name = "list", .has_arg = 2, .flag = NULL, .val = 'L' }, + { .name = "flush", .has_arg = 2, .flag = NULL, .val = 'F' }, + { .name = "zero", .has_arg = 2, .flag = NULL, .val = 'Z' }, + { .name = "new-chain", .has_arg = 1, .flag = NULL, .val = 'N' }, + { .name = "delete-chain", .has_arg = 2, .flag = NULL, .val = 'X' }, + { .name = "rename-chain", .has_arg = 1, .flag = NULL, .val = 'E' }, + { .name = "policy", .has_arg = 1, .flag = NULL, .val = 'P' }, + { .name = "source", .has_arg = 1, .flag = NULL, .val = 's' }, + { .name = "destination", .has_arg = 1, .flag = NULL, .val = 'd' }, + { .name = "src", .has_arg = 1, .flag = NULL, .val = 's' }, /* synonym */ + { .name = "dst", .has_arg = 1, .flag = NULL, .val = 'd' }, /* synonym */ + { .name = "protocol", .has_arg = 1, .flag = NULL, .val = 'p' }, + { .name = "in-interface", .has_arg = 1, .flag = NULL, .val = 'i' }, + { .name = "jump", .has_arg = 1, .flag = NULL, .val = 'j' }, + { .name = "table", .has_arg = 1, .flag = NULL, .val = 't' }, + { .name = "match", .has_arg = 1, .flag = NULL, .val = 'm' }, + { .name = "numeric", .has_arg = 0, .flag = NULL, .val = 'n' }, + { .name = "out-interface", .has_arg = 1, .flag = NULL, .val = 'o' }, + { .name = "verbose", .has_arg = 0, .flag = NULL, .val = 'v' }, + { .name = "exact", .has_arg = 0, .flag = NULL, .val = 'x' }, + { .name = "fragments", .has_arg = 0, .flag = NULL, .val = 'f' }, + { .name = "version", .has_arg = 0, .flag = NULL, .val = 'V' }, + { .name = "help", .has_arg = 2, .flag = NULL, .val = 'h' }, + { .name = "line-numbers", .has_arg = 0, .flag = NULL, .val = '0' }, + { .name = "modprobe", .has_arg = 1, .flag = NULL, .val = 'M' }, + { .name = "set-counters", .has_arg = 1, .flag = NULL, .val = 'c' }, + { .name = "goto", .has_arg = 1, .flag = NULL, .val = 'g' }, + { .name = NULL } }; /* we need this for iptables-restore. iptables-restore.c sets line to the @@ -574,7 +574,7 @@ if (invert) { unsigned int i; - for (i = 0; 1 << i != option; i++); + for (i = 0; (unsigned int)(1 << i) != option; i++); if (!inverse_for_options[i]) exit_error(PARAMETER_PROBLEM,