From 17dd9d0544b5d28eb28f5010918b52b96bce6da4 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 28 Feb 2017 17:19:55 +0100 Subject: [PATCH] radius: remove unused rule, add clarifying comment Since commit fdb5257f7cc8e19e6f8bcd35edee225cf44438a2 the ATTR_W_VENDOR symbol was never matched, so remove it. Change-Id: I5a56f48ce1995c23f9eca518308d3543a15ad049 Reviewed-on: https://code.wireshark.org/review/20313 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- epan/radius_dict.l | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/epan/radius_dict.l b/epan/radius_dict.l index 0ba517cf64..3dac0f7007 100644 --- a/epan/radius_dict.l +++ b/epan/radius_dict.l @@ -184,7 +184,7 @@ static void add_value(Radius_scanner_state_t* state, const gchar* attrib_name, c * name types in the FreeRadius dictionaries. */ -%START WS_OUT VENDOR VENDOR_W_NAME ATTR ATTR_W_NAME ATTR_W_ID ATTR_W_TYPE ATTR_W_VENDOR VALUE VALUE_W_ATTR VALUE_W_NAME INCLUDE JUNK BEGIN_VENDOR END_VENDOR VENDOR_W_ID VENDOR_W_FORMAT VENDOR_W_TYPE_OCTETS VENDOR_W_LENGTH_OCTETS VENDOR_W_CONTINUATION BEGIN_TLV END_TLV +%START WS_OUT VENDOR VENDOR_W_NAME ATTR ATTR_W_NAME ATTR_W_ID ATTR_W_TYPE VALUE VALUE_W_ATTR VALUE_W_NAME INCLUDE JUNK BEGIN_VENDOR END_VENDOR VENDOR_W_ID VENDOR_W_FORMAT VENDOR_W_TYPE_OCTETS VENDOR_W_LENGTH_OCTETS VENDOR_W_CONTINUATION BEGIN_TLV END_TLV %% [:blank:] ; #[^\n]* ; @@ -294,6 +294,11 @@ static void add_value(Radius_scanner_state_t* state, const gchar* attrib_name, c encrypt=[123][,]? { yyextra->encrypted = (guint) strtoul(yytext+8,NULL,10); } [0-9a-z_-]+=([^\n]*) ; [0-9a-z_-]+ { + /* + * Support for "ATTRIBUTE name number type [vendor|options]", it marks + * this as vendor-specific attribute (VSA), but this notation is deprecated + * in favor of BEGIN-VENDOR/END-VENDOR blocks. + */ gboolean attribute_ok; yyextra->attr_vendor = g_strdup(yytext); @@ -318,14 +323,6 @@ static void add_value(Radius_scanner_state_t* state, const gchar* attrib_name, c yyextra->encrypted=FALSE; BEGIN WS_OUT; } -\n { - add_attribute(yyextra, yyextra->attr_name, yyextra->attr_id, yyextra->attr_type, yyextra->attr_vendor, yyextra->encrypted, yyextra->has_tag, yyextra->current_attr); - g_free(yyextra->attr_id); - g_free(yyextra->attr_vendor); - g_free(yyextra->attr_name); - yyextra->linenums[yyextra->include_stack_ptr]++; - BEGIN WS_OUT; -}; [0-9a-z_/-]+ { yyextra->attr_name = g_strdup(yytext); BEGIN VALUE_W_ATTR; } [^[:blank:]]+ { yyextra->value_repr = g_strdup(yytext); BEGIN VALUE_W_NAME; }