diff options
author | Richard Weinberger <richard@nod.at> | 2011-08-27 15:32:31 +0200 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-08-27 18:36:19 +0200 |
commit | 2ca6273c73b42e8c74afd5f8b1fe10c5c93ce363 (patch) | |
tree | a6ab73b84fbfacb95b213a0d959c43c1f99be3f7 | |
parent | 3412bd0bfb8b8bac9834cbfd3392b3d5487133bf (diff) |
xtoptions: simplify xtables_parse_interface
mask is already filled with zeros, there is no need to zero it again.
References: http://marc.info/?l=netfilter-devel&m=131445196526269&w=2
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r-- | iptables/xtables.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c index 233efa30..e72aa284 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -515,15 +515,13 @@ void xtables_parse_interface(const char *arg, char *vianame, strcpy(vianame, arg); if (vialen == 0) - memset(mask, 0, IFNAMSIZ); + return; else if (vianame[vialen - 1] == '+') { memset(mask, 0xFF, vialen - 1); - memset(mask + vialen - 1, 0, IFNAMSIZ - vialen + 1); /* 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 (vianame[i] == '/' || vianame[i] == ' ') { |