[PATCH nft include v2 6/7] scanner: fix indesc_list stack to be in the correct order

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

 



This fixes the location displayed in error messages.

Signed-off-by: Laurent Fasnacht <fasnacht@xxxxxxxxxxxxx>
---
 src/scanner.l | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/scanner.l b/src/scanner.l
index 7f40c5c1..8407a2a1 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -668,7 +668,11 @@ addrstring	({macaddr}|{ip4addr}|{ip6addr})
 static void scanner_push_indesc(struct parser_state *state,
 				struct input_descriptor *indesc)
 {
-	list_add_tail(&indesc->list, &state->indesc_list);
+	if (!state->indesc) {
+		list_add_tail(&indesc->list, &state->indesc_list);
+	} else {
+		list_add(&indesc->list, &state->indesc->list);
+	}
 	state->indesc = indesc;
 	state->indesc_idx++;
 }
-- 
2.20.1






[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux