From 7df8ff65f8765e109053bd8799ca1faa7627e531 Mon Sep 17 00:00:00 2001 From: Rostislav Lisovy Date: Mon, 11 Jun 2012 18:08:58 +0200 Subject: [PATCH] em_can: Fixed parsing of multiple parameters --- tc/em_can.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tc/em_can.c b/tc/em_can.c index e0be32c..0cedebf 100644 --- a/tc/em_can.c +++ b/tc/em_can.c @@ -87,22 +87,19 @@ static int can_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr, return PARSE_ERR(a, "can: Improperly formed CAN ID & mask\n"); for (i = 1; i < (sizeof(rules_raw)/sizeof(struct can_filter)); i++) { + /* There is no another keyword to parse */ a = bstr_next(a); if (a == NULL) { break; } + a = bstr_next(a); + if (a == NULL) + return PARSE_ERR(a, "can: missing argument"); + ret = can_parse_rule(&rules_raw[i], a, iseff); if (ret == -1) return PARSE_ERR(a, "can: Improperly formed CAN ID & mask\n"); - -#if 0 - can_id = bstrtoul(a); - if (can_id == ULONG_MAX) - return PARSE_ERR(a, "can: invalid ID, must be numeric"); - - rules_raw[i].can_id = can_id | (iseff) ? CAN_EFF_FLAG : 0 ; -#endif } // FIX THIS !@#$% -- 2.39.2