Re: [nftables PATCH] rule: display rule handle as comment

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

 




Eric Leblond <eric@xxxxxxxxx> schrieb:

>Knowing the rule handle is necessary to be able to delete a single
>rule. It was not displayed till now in the output and it was thus
>impossible to remove a single rule.
>This patch modify the listing output to add a comment containing
>the handle.
>
>Signed-off-by: Eric Leblond <eric@xxxxxxxxx>
>---
> src/rule.c |    2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/src/rule.c b/src/rule.c
>index 9d9eaee..b2d7844 100644
>--- a/src/rule.c
>+++ b/src/rule.c
>@@ -13,6 +13,7 @@
> #include <stdio.h>
> #include <stdint.h>
> #include <string.h>
>+#include <inttypes.h>
> 
> #include <statement.h>
> #include <rule.h>
>@@ -136,6 +137,7 @@ void rule_print(const struct rule *rule)
> 		printf(" ");
> 		stmt->ops->print(stmt);
> 	}
>+	printf(" # handle %" PRIu64, rule->handle.handle);
> 	printf("\n");
> }
> 

The output is supposed to be parsable again and should also remain as readable as possible. I discussed this with Pablo, we agreed on adding a command line switch for this.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux