summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2001-05-12 04:38:31 +0000
committerHarald Welte <laforge@gnumonks.org>2001-05-12 04:38:31 +0000
commit6a4542adff70b5e07bc478000f022098226cae2c (patch)
tree079c49f6a082717fa1e04f66b50d91e9f0aca478
parent0aefbd37d69f3cd4091cfb691f394221bdd3ad9f (diff)
fixes '_' in interface names bug (iptables)
fixes '+' in interface names bug (iptables-save)
-rw-r--r--ip6tables-save.c2
-rw-r--r--ip6tables.c2
-rw-r--r--iptables-save.c2
-rw-r--r--iptables.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/ip6tables-save.c b/ip6tables-save.c
index 8957e137..4af811a0 100644
--- a/ip6tables-save.c
+++ b/ip6tables-save.c
@@ -51,7 +51,7 @@ print_iface(char letter, const char *iface, const unsigned char *mask,
if (iface[i] != '\0')
printf("%c", iface[i]);
} else {
- if (iface[i] != '\0')
+ if (iface[i] == '\0')
printf("+");
break;
}
diff --git a/ip6tables.c b/ip6tables.c
index ad2fc80c..123d6a44 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -745,7 +745,7 @@ parse_interface(const char *arg, char *vianame, unsigned char *mask)
memset(mask + vialen + 1, 0, IFNAMSIZ - vialen - 1);
}
for (i = 0; vianame[i]; i++) {
- if (!isalnum(vianame[i])) {
+ if (!isalnum(vianame[i]) && vianame[i] != '_') {
printf("Warning: wierd character in interface"
" `%s' (No aliases, :, ! or *).\n",
vianame);
diff --git a/iptables-save.c b/iptables-save.c
index 282ca7f8..4dd60a40 100644
--- a/iptables-save.c
+++ b/iptables-save.c
@@ -48,7 +48,7 @@ print_iface(char letter, const char *iface, const unsigned char *mask,
if (iface[i] != '\0')
printf("%c", iface[i]);
} else {
- if (iface[i] != '\0')
+ if (iface[i] == '\0')
printf("+");
break;
}
diff --git a/iptables.c b/iptables.c
index bc76f8c7..51aadddb 100644
--- a/iptables.c
+++ b/iptables.c
@@ -744,7 +744,7 @@ parse_interface(const char *arg, char *vianame, unsigned char *mask)
memset(mask + vialen + 1, 0, IFNAMSIZ - vialen - 1);
}
for (i = 0; vianame[i]; i++) {
- if (!isalnum(vianame[i])) {
+ if (!isalnum(vianame[i]) && vianame[i] != '_') {
printf("Warning: wierd character in interface"
" `%s' (No aliases, :, ! or *).\n",
vianame);