> 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; > +} > + -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
signature.asc
Description: Digital signature
_______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
