Skip to contentSkip to conversation

verdict type: handle verdict flags and encoded additional information

PATCH New Patrick McHardy 1 participant 1 message Aug 18, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 verdict type: handle verdict flags and encoded additional information

The kernel can handle this, nftables should also.

---
 src/datatype.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
src/datatype.c +13 -10
index 36d5985..fdfee54 100644
@@ -176,15 +176,6 @@ const struct datatype invalid_type = {
 static void verdict_type_print(const struct expr *expr)
 {
 	switch (expr->verdict) {
-	case NF_ACCEPT:
-		printf("accept");
-		break;
-	case NF_DROP:
-		printf("drop");
-		break;
-	case NF_QUEUE:
-		printf("queue");
-		break;
 	case NFT_CONTINUE:
 		printf("continue");
 		break;
@@ -201,7 +192,19 @@ static void verdict_type_print(const struct expr *expr)
 		printf("return");
 		break;
 	default:
-		BUG("invalid verdict value %u\n", expr->verdict);
+		switch (expr->verdict & NF_VERDICT_MASK) {
+		case NF_ACCEPT:
+			printf("accept");
+			break;
+		case NF_DROP:
+			printf("drop");
+			break;
+		case NF_QUEUE:
+			printf("queue");
+			break;
+		default:
+			BUG("invalid verdict value %u\n", expr->verdict);
+		}
 	}
 }
 
Signature · 1 line
1.9.3