[iptables] Lift restrictions on interface names
Patrick McHardy
netfilter-cvslog-bounces at lists.netfilter.org
Tue Feb 9 15:59:53 CET 2010
Gitweb: http://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=fcf5723f415c81fcb2c93094cdcc39b35a316ff2
commit fcf5723f415c81fcb2c93094cdcc39b35a316ff2
Author: Jan Engelhardt <jengelh at medozas.de>
AuthorDate: Tue Feb 9 15:59:13 2010 +0100
Commit: Patrick McHardy <kaber at trash.net>
CommitDate: Tue Feb 9 15:59:13 2010 +0100
Lift restrictions on interface names
The kernel has few restrictions.
Signed-off-by: Jan Engelhardt <jengelh at medozas.de>
Signed-off-by: Patrick McHardy <kaber at trash.net>
via fcf5723f415c81fcb2c93094cdcc39b35a316ff2 (commit)
from 350661a6eb089f3e54e67e022db9e16ea280499f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fcf5723f415c81fcb2c93094cdcc39b35a316ff2
Author: Jan Engelhardt <jengelh at medozas.de>
Date: Tue Feb 9 15:59:13 2010 +0100
Lift restrictions on interface names
The kernel has few restrictions.
Signed-off-by: Jan Engelhardt <jengelh at medozas.de>
Signed-off-by: Patrick McHardy <kaber at trash.net>
-----------------------------------------------------------------------
xtables.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
The kernel has few restrictions.
Signed-off-by: Jan Engelhardt <jengelh at medozas.de>
Signed-off-by: Patrick McHardy <kaber at trash.net>
diff --git a/xtables.c b/xtables.c
index 63c5db7..f3baf84 100644
--- a/xtables.c
+++ b/xtables.c
@@ -450,7 +450,7 @@ u_int16_t xtables_parse_port(const char *port, const char *proto)
void xtables_parse_interface(const char *arg, char *vianame,
unsigned char *mask)
{
- int vialen = strlen(arg);
+ unsigned int vialen = strlen(arg);
unsigned int i;
memset(mask, 0, IFNAMSIZ);
@@ -462,7 +462,7 @@ void xtables_parse_interface(const char *arg, char *vianame,
" (%i)", arg, IFNAMSIZ-1);
strcpy(vianame, arg);
- if ((vialen == 0) || (vialen == 1 && vianame[0] == '+'))
+ if (vialen == 0)
memset(mask, 0, IFNAMSIZ);
else if (vianame[vialen - 1] == '+') {
memset(mask, 0xFF, vialen - 1);
@@ -473,12 +473,11 @@ void xtables_parse_interface(const char *arg, char *vianame,
memset(mask, 0xFF, vialen + 1);
memset(mask + vialen + 1, 0, IFNAMSIZ - vialen - 1);
for (i = 0; vianame[i]; i++) {
- if (vianame[i] == ':' ||
- vianame[i] == '!' ||
- vianame[i] == '*') {
+ if (vianame[i] == '/' ||
+ vianame[i] == ' ') {
fprintf(stderr,
"Warning: weird character in interface"
- " `%s' (No aliases, :, ! or *).\n",
+ " `%s' ('/' and ' ' are not allowed by the kernel).\n",
vianame);
break;
}
More information about the netfilter-cvslog
mailing list