summaryrefslogtreecommitdiffstats
path: root/src/erec.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-08-16 23:30:18 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-08-18 03:14:58 +0200
commit6f2eb8548e0d18078989adec069b438b2f154767 (patch)
tree6e2e838e8a6c20f24a8ce2d8fea65e0fa3966f26 /src/erec.c
parent860979abdbe3081c310a5acd9250abdfcb741ce4 (diff)
src: meta priority support using tc classid
This patch adds the missing bits to scan and parse the meta priority handle as expressed by tc classid major:minor syntax. The :minor syntax is not support for two reason: major is always >= 1 and this clashes with port syntax in nat. Here below, several example on how to match the packet priority field: nft add rule filter forward meta priority abcd:0 nft add rule filter forward meta priority abcd:1234 and to set it, you have to: nft add rule filter forward meta priority set abcd:1234 The priority expression in flex looks ahead to restrict the pattern to avoid problems with mappings: {classid}/[ \t\n:\-},] So the following doesn't break: ... vmap { 25:accept } ^^^^^ The lookahead expression requires a slight change to extend the input string in one byte. This patch is conservative as you always have to explicity indicate major and minor numbers even if zero. We could consider supporting this shortcut in the future: abcd: However, with regards to this: :abcd We don't need to support it since major number is assumed to be >= 1. However, if we ever decide to support this, we'll have problems since this clashes with our port representation in redirect and mangle. So let's keep this simple and start with this approach. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/erec.c')
-rw-r--r--src/erec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/erec.c b/src/erec.c
index 0a1e6c74..36032165 100644
--- a/src/erec.c
+++ b/src/erec.c
@@ -92,6 +92,7 @@ void erec_print(FILE *f, const struct error_record *erec)
case INDESC_BUFFER:
case INDESC_CLI:
line = indesc->data;
+ *strchrnul(line, '\n') = '\0';
break;
case INDESC_FILE:
memset(buf, 0, sizeof(buf));