[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20091020.003538.84720318.davem@davemloft.net>
Date: Tue, 20 Oct 2009 00:35:38 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: wg@...ndegger.com
Cc: netdev@...r.kernel.org, socketcan-core@...ts.berlios.de,
haas@...-wuensche.com, anantgole@...com, mkl@...gutronix.de
Subject: Re: [PATCH v3] can: provide library functions for skb allocation
From: Wolfgang Grandegger <wg@...ndegger.com>
Date: Tue, 20 Oct 2009 08:44:05 +0200
> 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. It's now done as shown
> below:
>
> skb->protocol = 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 zeroed out to avoid uninitialized data to be passed to
> user space. Some drivers or library code did not set "pkt_type" or
> "ip_summed". Also, "__constant_htons()" should not be used for
> runtime invocations, as pointed out by David Miller.
>
> Signed-off-by: Wolfgang Grandegger <wg@...ndegger.com>
Wow, it builds, applied :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists