From ce95fbdda01f459d17cb2f2093a310f66df9d57f Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 11 Jun 2013 15:41:21 +0200 Subject: [PATCH] action handling: add test to avoid direct access Direct access to the action field of Packet structure is not allowed. --- qa/coccinelle/action-pkt.cocci | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 qa/coccinelle/action-pkt.cocci diff --git a/qa/coccinelle/action-pkt.cocci b/qa/coccinelle/action-pkt.cocci new file mode 100644 index 0000000000..1a66721ac8 --- /dev/null +++ b/qa/coccinelle/action-pkt.cocci @@ -0,0 +1,15 @@ +@action@ +typedef Packet; +Packet *p; +position p1; +@@ + +p->action@p1 + +@ script:python @ +p1 << action.p1; +@@ + +print "Invalid usage of p->action, please use macro at %s:%s" % (p1[0].file, p1[0].line) +import sys +sys.exit(1)