From 2ca6273c73b42e8c74afd5f8b1fe10c5c93ce363 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Sat, 27 Aug 2011 15:32:31 +0200 Subject: 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 --- iptables/xtables.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'iptables/xtables.c') 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] == ' ') { -- cgit v1.2.3