From 10da57e36147bf5c73cd2820e11ec124ecfffc83 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 25 Apr 2019 14:56:54 +0200 Subject: src: use UDATA defines from libnftnl Userdata attribute names have been added to libnftnl, use them instead of the local copy. While being at it, rename udata_get_comment() in netlink_delinearize.c and the callback it uses since the function is specific to rules. Also integrate the existence check for NFTNL_RULE_USERDATA into it along with the call to nftnl_rule_get_data(). Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 4a2a81cd..9aea6526 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -2185,8 +2186,9 @@ ruleid_spec : chain_spec handle_spec comment_spec : COMMENT string { - if (strlen($2) > UDATA_COMMENT_MAXLEN) { - erec_queue(error(&@2, "comment too long, %d characters maximum allowed", UDATA_COMMENT_MAXLEN), + if (strlen($2) > NFTNL_UDATA_COMMENT_MAXLEN) { + erec_queue(error(&@2, "comment too long, %d characters maximum allowed", + NFTNL_UDATA_COMMENT_MAXLEN), state->msgs); YYERROR; } -- cgit v1.2.3