[PATCH libnftnl 2/2] obj: ct_timeout: don't skip zero value timeout

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

 



It's a valid configuration, don't assume this means timeout is unset.

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/obj/ct_timeout.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/obj/ct_timeout.c b/src/obj/ct_timeout.c
index fe0689a8adab..7c2ea97e7821 100644
--- a/src/obj/ct_timeout.c
+++ b/src/obj/ct_timeout.c
@@ -223,10 +223,9 @@ nftnl_obj_ct_timeout_build(struct nlmsghdr *nlh, const struct nftnl_obj *e)
 		int i;
 
 		nest = mnl_attr_nest_start(nlh, NFTA_CT_TIMEOUT_DATA);
-		for (i = 0; i < timeout_protocol[timeout->l4proto].attr_max; i++) {
-			if (timeout->timeout[i])
-				mnl_attr_put_u32(nlh, i+1, htonl(timeout->timeout[i]));
-		}
+		for (i = 0; i < timeout_protocol[timeout->l4proto].attr_max; i++)
+			mnl_attr_put_u32(nlh, i+1, htonl(timeout->timeout[i]));
+
 		mnl_attr_nest_end(nlh, nest);
 	}
 }
-- 
2.11.0




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

  Powered by Linux