Wolfgang Grandegger wrote:
> This patch makes the private functions alloc_can_skb() and
> alloc_can_err_skb() of the at91_can driver public and adapts all
> drivers to use these. While making the patch I realized, that
> the skb's are *not* setup consistently. The skb's are now setup
> as shown:
> 
>       skb->protocol = __constant_htons(ETH_P_CAN);
>       skb->pkt_type = PACKET_BROADCAST;
>       skb->ip_summed = CHECKSUM_UNNECESSARY;
>       *cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
>       memset(*cf, 0, sizeof(struct can_frame));
> 
> The frame is zero'ed out to avoid uninitialized data to be passed
> to user space.
> 
> Some drivers or library code used "htons(ETH_P_CAN)" or did not set
> "pkt_type" or "ip_summed" or did not zero the fame.
> 
> Signed-off-by: Wolfgang Grandegger <[email protected]>

Very nice!

If you like, add my

Acked-by: Oliver Hartkopp <[email protected]>

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

Reply via email to