From eea2167b73ce5fb1976c093efa5b69e7ed3da570 Mon Sep 17 00:00:00 2001 From: Rostislav Lisovy Date: Mon, 11 Jun 2012 16:41:35 +0200 Subject: [PATCH] em_can: Significant bug fixes --- tc/em_can.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tc/em_can.c b/tc/em_can.c index 4c0984d..e0be32c 100644 --- a/tc/em_can.c +++ b/tc/em_can.c @@ -48,7 +48,7 @@ static int can_parse_rule(struct can_filter *rule, struct bstr *a, int iseff) } else can_mask = CAN_SFF_MASK; } - rule->can_id = can_id | (iseff) ? CAN_EFF_FLAG : 0 ; + rule->can_id = can_id | ((iseff) ? CAN_EFF_FLAG : 0) ; rule->can_mask = can_mask; return 0; @@ -87,9 +87,10 @@ 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++) { - a = bstr_next(args); - if (a == NULL) + a = bstr_next(a); + if (a == NULL) { break; + } ret = can_parse_rule(&rules_raw[i], a, iseff); if (ret == -1) @@ -104,8 +105,9 @@ static int can_parse_eopt(struct nlmsghdr *n, struct tcf_ematch_hdr *hdr, #endif } - if (a->next) - return PARSE_ERR(a->next, "can: unexpected trailer"); + // FIX THIS !@#$% + //if (a->next) + // return PARSE_ERR(a->next, "can: unexpected trailer"); addraw_l(n, MAX_MSG, hdr, sizeof(*hdr)); addraw_l(n, MAX_MSG, &rules_raw, sizeof(struct can_filter) * i); // FIXME is size ok -- 2.39.2