cangw: remove sanity checks that are better handled in the kernel

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/145/head
Oliver Hartkopp 2019-01-10 20:56:59 +01:00
parent 24923df749
commit 07054c06f5
1 changed files with 2 additions and 10 deletions

12
cangw.c
View File

@ -338,19 +338,11 @@ int parse_mod(char *optarg, struct modattr *modmsg)
return 5;
modmsg->cf.can_id = can_id;
/* 4-bit masks can have values from 0 to 0xF */
if (modmsg->cf.can_dlc > 0xF)
if (strlen(hexdata) != 16)
return 6;
/* but when setting CAN_DLC the value has to be limited to 8 */
if (modmsg->instruction == CGW_MOD_SET && modmsg->cf.can_dlc > 8)
return 7;
if (strlen(hexdata) != 16)
return 8;
if (b64hex(hexdata, &modmsg->cf.data[0], 8))
return 9;
return 7;
return 0; /* ok */
}