xt_rm = NULL;
xt_m = NULL;
xt_t = NULL;
- ret = 0;
+ /* Default code for options parsing */
+ ret = -EINVAL;
/* extension's options will generate false-positives errors */
opterr = 0;
table_name = optarg;
table = iptables_init(table_name);
- if (table == NULL) {
- ret = -EINVAL;
+ if (table == NULL)
goto out;
- }
break;
connman_error("Invalid option");
- ret = -EINVAL;
goto out;
default:
table_name = "filter";
table = iptables_init(table_name);
- if (table == NULL) {
- ret = -EINVAL;
+ if (table == NULL)
goto out;
- }
}
+ /* Option parsing went fine, falling back to succes code */
+ ret = 0;
+
if (delete_chain != NULL) {
printf("Delete chain %s\n", delete_chain);
if (dump) {
iptables_dump(table);
- ret = 0;
goto out;
}