cangw: add semantic check for checksum options
The options to for adding checksums (-c or -x) can only be used in conjunction with modifications (-m) applied to the routed CAN frames. Signed-off-by: Andre Naujoks <nautsch2@googlemail.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>pull/7/head
parent
d166ecc8a3
commit
f123d73d9a
5
cangw.c
5
cangw.c
|
|
@ -669,6 +669,11 @@ int main(int argc, char **argv)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!modidx && (have_cs_crc8 || have_cs_xor)) {
|
||||||
|
printf("-c or -x can only be used in conjunction with -m\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
s = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue