mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-04 22:09:57 +02:00
Added program exit on SIOCGIFINDEX error.
This commit is contained in:
@@ -198,8 +198,10 @@ int main(int argc, char **argv)
|
||||
addr.can_family = AF_CAN;
|
||||
|
||||
strcpy(ifr.ifr_name, argv[optind]);
|
||||
if (ioctl(s, SIOCGIFINDEX, &ifr) < 0)
|
||||
if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
|
||||
perror("SIOCGIFINDEX");
|
||||
return 1;
|
||||
}
|
||||
addr.can_ifindex = ifr.ifr_ifindex;
|
||||
|
||||
/* disable default receive filter on this RAW socket */
|
||||
|
||||
Reference in New Issue
Block a user