168a169,172
> #if PCAP_SUPPORT_CANUSB
> #include "pcap-canusb-linux.h"
> #endif
>
420a425,430
> #if PCAP_SUPPORT_CANUSB
> if (strstr(device, "canusb")) {
> return canusb_create(device, ebuf);
> }
> #endif
>
422c432,433
< if (strstr(device, "can") || strstr(device, "vcan")) {
---
> if ((strncmp(device, "can", 3) == 0 && isdigit(device[3])) ||
> (strncmp(device, "vcan", 4) == 0 && isdigit(device[4]))) {
2301a2313,2317
> #if PCAP_SUPPORT_CANUSB
> if (canusb_platform_finddevs(alldevsp, errbuf) < 0)
> return (-1);
> #endif
>
5405a5422,5427
> } else if (p->k == 0) {
> /*
> * It's the packet type field; map it to the special magic
> * kernel offset for that field.
> */
> p->k = SKF_AD_OFF + SKF_AD_PKTTYPE;
5412c5434
< } else {
---
> } else if ((bpf_int32)(p->k) > 0) {
> #if PCAP_SUPPORT_CANUSB
> #include "pcap-canusb-linux.h"
> #endif
>
420a425,430
> #if PCAP_SUPPORT_CANUSB
> if (strstr(device, "canusb")) {
> return canusb_create(device, ebuf);
> }
> #endif
>
422c432,433
< if (strstr(device, "can") || strstr(device, "vcan")) {
---
> if ((strncmp(device, "can", 3) == 0 && isdigit(device[3])) ||
> (strncmp(device, "vcan", 4) == 0 && isdigit(device[4]))) {
2301a2313,2317
> #if PCAP_SUPPORT_CANUSB
> if (canusb_platform_finddevs(alldevsp, errbuf) < 0)
> return (-1);
> #endif
>
5405a5422,5427
> } else if (p->k == 0) {
> /*
> * It's the packet type field; map it to the special magic
> * kernel offset for that field.
> */
> p->k = SKF_AD_OFF + SKF_AD_PKTTYPE;
5412c5434
< } else {
---
> } else if ((bpf_int32)(p->k) > 0) {