diff options
Diffstat (limited to 'src/expression.c')
-rw-r--r-- | src/expression.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/expression.c b/src/expression.c index cb2573fe..c0cb7f22 100644 --- a/src/expression.c +++ b/src/expression.c @@ -183,15 +183,6 @@ void expr_describe(const struct expr *expr, struct output_ctx *octx) } } -void expr_to_string(const struct expr *expr, char *string) -{ - int len = expr->len / BITS_PER_BYTE; - - assert(expr->dtype == &string_type); - - mpz_export_data(string, expr->value, BYTEORDER_HOST_ENDIAN, len); -} - void expr_set_type(struct expr *expr, const struct datatype *dtype, enum byteorder byteorder) { @@ -1323,9 +1314,14 @@ static void set_elem_expr_print(const struct expr *expr, } if (expr->timeout) { nft_print(octx, " timeout "); - time_print(expr->timeout, octx); + if (expr->timeout == NFT_NEVER_TIMEOUT) + nft_print(octx, "never"); + else + time_print(expr->timeout, octx); } - if (!nft_output_stateless(octx) && expr->expiration) { + if (!nft_output_stateless(octx) && + expr->timeout != NFT_NEVER_TIMEOUT && + expr->expiration) { nft_print(octx, " expires "); time_print(expr->expiration, octx); } |