From: Rostislav Lisovy Date: Fri, 29 Jun 2012 08:43:53 +0000 (+0200) Subject: em_canid: Fix correct EFF_FLAG setting X-Git-Url: https://rtime.felk.cvut.cz/gitweb/lisovros/iproute2_canprio.git/commitdiff_plain/873c5427e11819e33d87a5fb2e4306f0bcfa209f em_canid: Fix correct EFF_FLAG setting --- diff --git a/tc/em_canid.c b/tc/em_canid.c index 8ec78b8..1590b94 100644 --- a/tc/em_canid.c +++ b/tc/em_canid.c @@ -56,7 +56,7 @@ static int canid_parse_rule(struct can_filter *rule, struct bstr *a, int iseff) } } rule->can_id = can_id | ((iseff) ? CAN_EFF_FLAG : 0); - rule->can_mask = can_mask | ((iseff) ? CAN_EFF_FLAG : 0); + rule->can_mask = can_mask | CAN_EFF_FLAG; return 0; } @@ -155,13 +155,13 @@ static int canid_print_eopt(FILE *fd, struct tcf_ematch_hdr *hdr, void *data, pcfltr->can_id & CAN_EFF_MASK, pcfltr->can_mask & CAN_EFF_MASK); } else { - if (pcfltr->can_mask == CAN_SFF_MASK) + if (pcfltr->can_mask == (CAN_EFF_FLAG|CAN_SFF_MASK)) fprintf(fd, "sff 0x%"PRIX32, - pcfltr->can_id); + pcfltr->can_id & CAN_SFF_MASK); else fprintf(fd, "sff 0x%"PRIX32":0x%"PRIX32, - pcfltr->can_id, - pcfltr->can_mask); + pcfltr->can_id & CAN_SFF_MASK, + pcfltr->can_mask & CAN_SFF_MASK); } if ((i + 1) < rules_count)