On Thu, Dec 17, 2009 at 4:04 PM, Wolfram Sang <[email protected]> wrote:
>> diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
>> index 3db7767..b70d6f3 100644
>> --- a/include/linux/can/dev.h
>> +++ b/include/linux/can/dev.h
>> @@ -77,6 +77,16 @@ void can_put_echo_skb(struct sk_buff *skb, struct
>> net_device *dev,
>>  void can_get_echo_skb(struct net_device *dev, unsigned int idx);
>>  void can_free_echo_skb(struct net_device *dev, unsigned int idx);
>>
>> +static inline int can_validate_skb(struct sk_buff *skb)
>> +{
>> +     struct can_frame *cf = (struct can_frame *)skb->data;
>> +
>> +     if (unlikely(skb->len != sizeof(struct can_frame) || cf->can_dlc > 8))
>> +             return 1;
>
> Maybe -Esomething?
>
>> +
>> +     return 0;
>> +}
>> +
or perhaps:
return (unlikely(skb->len != sizeof(struct can_frame) || cf->can_dlc > 8)

Daniel.
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to