[nft PATCH 1/3] meta: Reject zero ifindex values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 src/meta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/meta.c b/src/meta.c
index 1e8964eb48c4d..b12340991f35a 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -155,7 +155,7 @@ static struct error_record *ifindex_type_parse(const struct expr *sym,
 		errno = 0;
 		res = strtol(sym->identifier, &end, 10);
 
-		if (res < 0 || res > INT_MAX || *end || errno)
+		if (res <= 0 || res > INT_MAX || *end || errno)
 			return error(&sym->location, "Interface does not exist");
 
 		ifindex = (int)res;
-- 
2.22.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux