[PATCH ipset 2/4] Simplify return statement in ipset_mnl_query()

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

 



As we loop as long as 'ret' is greater than zero, and break only
if we get an error in mnl_cb_run2 (with ret <= 0), we can just
return ret without checking once more if it's greater than zero.

Signed-off-by: Stefano Brivio <sbrivio@xxxxxxxxxx>
---
 lib/mnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/mnl.c b/lib/mnl.c
index a0fa66ecdb80..4e075cf94f00 100644
--- a/lib/mnl.c
+++ b/lib/mnl.c
@@ -115,7 +115,7 @@ ipset_mnl_query(struct ipset_handle *handle, void *buffer, size_t len)
 		ret = mnl_socket_recvfrom(handle->h, buffer, len);
 		D("message received, ret: %d", ret);
 	}
-	return ret > 0 ? 0 : ret;
+	return ret;
 }
 
 static struct ipset_handle *
-- 
2.18.0




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux