cangw: remove sanity checks that are better handled in the kernel
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>pull/145/head
parent
24923df749
commit
07054c06f5
12
cangw.c
12
cangw.c
|
|
@ -338,19 +338,11 @@ int parse_mod(char *optarg, struct modattr *modmsg)
|
||||||
return 5;
|
return 5;
|
||||||
modmsg->cf.can_id = can_id;
|
modmsg->cf.can_id = can_id;
|
||||||
|
|
||||||
/* 4-bit masks can have values from 0 to 0xF */
|
if (strlen(hexdata) != 16)
|
||||||
if (modmsg->cf.can_dlc > 0xF)
|
|
||||||
return 6;
|
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))
|
if (b64hex(hexdata, &modmsg->cf.data[0], 8))
|
||||||
return 9;
|
return 7;
|
||||||
|
|
||||||
return 0; /* ok */
|
return 0; /* ok */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue