diff options
author | Oliver Hartkopp <oliver@hartkopp.net> | 2010-01-12 05:00:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-12 05:00:46 -0500 |
commit | 3ccd4c6167d3b39d52631767ebbf8b5677c5855d (patch) | |
tree | bfcb801edebd00e8b30e897038bad7fee39625cc /drivers/net/can/mscan | |
parent | d218d11133d888f9745802146a50255a4781d37a (diff) |
can: Unify droping of invalid tx skbs and netdev stats
To prevent the CAN drivers to operate on invalid socketbuffers the skbs are
now checked and silently dropped at the xmit-function consistently.
Also the netdev stats are consistently using the CAN data length code (dlc)
for [rx|tx]_bytes now.
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/mscan')
-rw-r--r-- | drivers/net/can/mscan/mscan.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c index 500d18918bd5..40827c128b65 100644 --- a/drivers/net/can/mscan/mscan.c +++ b/drivers/net/can/mscan/mscan.c | |||
@@ -204,11 +204,8 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
204 | int i, rtr, buf_id; | 204 | int i, rtr, buf_id; |
205 | u32 can_id; | 205 | u32 can_id; |
206 | 206 | ||
207 | if (skb->len != sizeof(*frame) || frame->can_dlc > 8) { | 207 | if (can_dropped_invalid_skb(dev, skb)) |
208 | kfree_skb(skb); | ||
209 | dev->stats.tx_dropped++; | ||
210 | return NETDEV_TX_OK; | 208 | return NETDEV_TX_OK; |
211 | } | ||
212 | 209 | ||
213 | out_8(®s->cantier, 0); | 210 | out_8(®s->cantier, 0); |
214 | 211 | ||