diff options
author | laforge <laforge> | 2001-05-23 23:07:33 +0000 |
---|---|---|
committer | laforge <laforge> | 2001-05-23 23:07:33 +0000 |
commit | c36904f779afba8aa846bec3a32fadc50f8daafb (patch) | |
tree | e681e74c7cad997dc4592e45d6bcd54984922aad /iptables.c | |
parent | d3a65a8b5e11ba89d09685589bf39d3ac3016409 (diff) |
hopefully fixed the multiple-interface iptables-save problem
Diffstat (limited to 'iptables.c')
-rw-r--r-- | iptables.c | 25 |
1 files changed, 8 insertions, 17 deletions
@@ -736,19 +736,18 @@ parse_interface(const char *arg, char *vianame, unsigned char *mask) else if (vianame[vialen - 1] == '+') { memset(mask, 0xFF, vialen - 1); memset(mask + vialen - 1, 0, IFNAMSIZ - vialen + 1); - /* Remove `+' */ - vianame[vialen - 1] = '\0'; + /* Don't remove `+' here! -HW */ } else { /* Include nul-terminator in match */ memset(mask, 0xFF, vialen + 1); memset(mask + vialen + 1, 0, IFNAMSIZ - vialen - 1); - } - for (i = 0; vianame[i]; i++) { - if (!isalnum(vianame[i]) && vianame[i] != '_') { - printf("Warning: wierd character in interface" - " `%s' (No aliases, :, ! or *).\n", - vianame); - break; + for (i = 0; vianame[i]; i++) { + if (!isalnum(vianame[i]) && vianame[i] != '_') { + printf("Warning: wierd character in interface" + " `%s' (No aliases, :, ! or *).\n", + vianame); + break; + } } } } @@ -1165,10 +1164,6 @@ print_firewall(const struct ipt_entry *fw, if (fw->ip.iniface[0] != '\0') { strcat(iface, fw->ip.iniface); - /* If it doesn't compare the nul-term, it's a - wildcard. */ - if (fw->ip.iniface_mask[strlen(fw->ip.iniface)] == 0) - strcat(iface, "+"); } else if (format & FMT_NUMERIC) strcat(iface, "*"); else strcat(iface, "any"); @@ -1182,10 +1177,6 @@ print_firewall(const struct ipt_entry *fw, if (fw->ip.outiface[0] != '\0') { strcat(iface, fw->ip.outiface); - /* If it doesn't compare the nul-term, it's a - wildcard. */ - if (fw->ip.outiface_mask[strlen(fw->ip.outiface)] == 0) - strcat(iface, "+"); } else if (format & FMT_NUMERIC) strcat(iface, "*"); else strcat(iface, "any"); |